Click here to Skip to main content
15,889,863 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help with Sqldatareader Pin
Colin Angus Mackay11-Aug-07 8:54
Colin Angus Mackay11-Aug-07 8:54 
GeneralRe: Need help with Sqldatareader Pin
erikhjerpe11-Aug-07 9:09
erikhjerpe11-Aug-07 9:09 
GeneralRe: Need help with Sqldatareader Pin
Justin.Jones11-Aug-07 18:01
Justin.Jones11-Aug-07 18:01 
Questionupdating javascript value to database Pin
dsaikrishna11-Aug-07 2:03
dsaikrishna11-Aug-07 2:03 
AnswerRe: updating javascript value to database Pin
Guffa11-Aug-07 2:27
Guffa11-Aug-07 2:27 
GeneralRe: updating javascript value to database Pin
dsaikrishna11-Aug-07 2:36
dsaikrishna11-Aug-07 2:36 
GeneralRe: updating javascript value to database Pin
Justin.Jones11-Aug-07 18:14
Justin.Jones11-Aug-07 18:14 
AnswerRe: updating javascript value to database Pin
Michael Sync12-Aug-07 3:56
Michael Sync12-Aug-07 3:56 
dsaikrishna wrote:
I am facing a problem with a javascript function i had with me javascript for country generation and also on change of country state generation w.r.t of country but i want to fetch the selected value of country and state and to update in the database using sqlserver.


Okay.

#1. Declare one variable in code-behind to hold the status.

string selectedCountry = string.Empty;

#2. Add one server-side hidden field (a HTML hidden field with RunAt="Server") in your page.

<input id="Hidden1" type="hidden" runat="server" onserverchange="Hidden1_ServerChange"/><br />


#3. Add change event of this hidden field
<br />
 protected void Hidden1_ServerChange(object sender, EventArgs e)<br />
    {<br />
<br />
    }


#4. In onchange event of Country list, you can set the value to this hidden field.. For example, if you select "Singapore" from combobox, set this to hidden field by using javascript.

var objHdf = document.getElementById('Hidden1');<br />
objHdf.value = document.getElementById('cboCountry').selectedtext;<br />


#5. As soon as the value of hidden field get changed, the server side event of hidden field will be invoked. So, get the value from hidden and set it to string that we declare earlier..

<br />
protected void Hidden1_ServerChange(object sender, EventArgs e)<br />
    {<br />
        selectedCountry = Hidden1.Value;    <br />
    }


Okay. now, you get the value so, you can insert it to SQL database..

Hope it helps.. Smile | :)




Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)

If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. Smile | :)

Questionhi friends , do any one know how to create crystal reports Pin
prasadbuddhika11-Aug-07 0:06
prasadbuddhika11-Aug-07 0:06 
AnswerRe: hi friends , do any one know how to create crystal reports Pin
Rami Said Abd Alhalim11-Aug-07 1:43
Rami Said Abd Alhalim11-Aug-07 1:43 
QuestionRead a value from another form ! Pin
mrkeivan10-Aug-07 21:25
mrkeivan10-Aug-07 21:25 
AnswerRe: Read a value from another form ! Pin
Hessam Jalali10-Aug-07 21:49
Hessam Jalali10-Aug-07 21:49 
AnswerRe: Read a value from another form ! Pin
Giorgi Dalakishvili10-Aug-07 22:16
mentorGiorgi Dalakishvili10-Aug-07 22:16 
AnswerRe: Read a value from another form ! Pin
Michael Sync12-Aug-07 4:04
Michael Sync12-Aug-07 4:04 
Questionmdi parent form Pin
monuSaini10-Aug-07 20:09
monuSaini10-Aug-07 20:09 
AnswerRe: mdi parent form Pin
Hessam Jalali10-Aug-07 20:36
Hessam Jalali10-Aug-07 20:36 
GeneralRe: mdi parent form Pin
monuSaini10-Aug-07 20:58
monuSaini10-Aug-07 20:58 
GeneralRe: mdi parent form Pin
Hessam Jalali10-Aug-07 21:09
Hessam Jalali10-Aug-07 21:09 
Questioninternal /internal protected Pin
Sonia Gupta10-Aug-07 19:07
Sonia Gupta10-Aug-07 19:07 
GeneralRe: internal /internal protected Pin
Guffa11-Aug-07 2:10
Guffa11-Aug-07 2:10 
GeneralRe: internal /internal protected Pin
chinaQI11-Aug-07 6:39
chinaQI11-Aug-07 6:39 
QuestionThumbnail Pin
sathishkumar198210-Aug-07 18:44
sathishkumar198210-Aug-07 18:44 
AnswerRe: Thumbnail Pin
Csharp™11-Aug-07 23:24
Csharp™11-Aug-07 23:24 
QuestionAddDomain.Load() Pin
BoneSoft10-Aug-07 16:54
BoneSoft10-Aug-07 16:54 
QuestionToolStrip drags Pin
juFo10-Aug-07 13:15
juFo10-Aug-07 13:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.