C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




To:Gomathinayagam


Posted Date: 16 Oct 2008      Total Responses: 1

Posted By: sheeba Angela       Member Level: Gold     Points: 1


Hi

I got the checked checkbox value through HiddenField.

This is my table emailaddressdetails:

Email_id int
Email_address nvarchar(225)
First_name nvarchar(MAX)
Last_name nvarchar(MAX)
classificationame int

See first i will tell my situation:

I have 2 pages: First page is test1.aspx.

Test1.aspx:

1.It has one listbox and textbox control for classificationname.
2.when i enter the classificationname to the textbox it will diplay through the listbox at a time.
3.That means classificationname are added to the database at a time.


Second page is Test2.aspx:

Here i have

Email_address-textbox,
First_name-textbox,
Last_name-textbox,
classificationname-checkbox.

Here when i enter classificationname in test1.aspx

1.In test2.aspx automatically one checkbox will created dynamically.
2.Now i entered email,fname,lname,And select the checkbox which contains classificationname.and then click save button.
3.So i need checkbox id which is selected, to store it in the database.
4.Now i retrieve that checked checkbox value.(got it through hiddenfield.)
5.In case i have to select more than one check box means,i should store more tah one classificationname in same emailid:5.
6.So i want to add that checked checkbox id's,it should be separate by comma(',').
7.That time my table contains classificationname like this:
chk1,chk2.


I want to display the classification values like this:

Emailid Emailadd Fname Lname Classificationame

5 ddf@as.com fdf fgfg chk1,chk2

How to use split function?

I think now you can understand ...

Thank you so much







Responses

Author: gomathinayagam    16 Oct 2008Member Level: GoldRating:     Points: 2

string str;
foreach (control di in placeholder.controls)
{
for(i=0;i<=count;i++)
HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckId"+ i);
if (chkBx != null && chkBx.Checked)
{
str = str + "*" + chkBx.value;

}

}

now str is like = chk1*chk2;

to split a string

string str = "as*df";
string[] str1 = str.Split('*');

now str1 is a string array it contains the splited string in array format.

i think it helps u.



Post Reply
You must Sign In to post a response.
Next : Convert to MB
Previous : how to Retrive url
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing

Contact Us    Privacy Policy    Terms Of Use