Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > using javascript __doPostBack inside C# code-behinde

Reply
Thread Tools

using javascript __doPostBack inside C# code-behinde

 
 
bredal Jensen
Guest
Posts: n/a
 
      04-27-2004

I'm trying to generate a postback to the server when
my radio button is selected.

This code MyRadio.Attributes.Add("onclick",__doPosback(info, '')) does
generate a javascript error.
Info is an integer value i need to send to my server in the query string
.....
Can someone help me with this?

Thanks


 
Reply With Quote
 
 
 
 
Ashish M Bhonkiya
Guest
Posts: n/a
 
      04-27-2004
Hi bredal Jensen,

try this.
MyRadio.Attributes.Add("onclick","__doPosback("+ info.ToString() +",'')");

HTH
Regards
Ashish M Bhonkiya

"bredal Jensen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I'm trying to generate a postback to the server when
> my radio button is selected.
>
> This code MyRadio.Attributes.Add("onclick",__doPosback(info, '')) does
> generate a javascript error.
> Info is an integer value i need to send to my server in the query string
> ....
> Can someone help me with this?
>
> Thanks
>
>



 
Reply With Quote
 
 
 
 
bredal Jensen
Guest
Posts: n/a
 
      04-27-2004
That worked great..
By the way, how many different parameters can one send in the __DoPostBack
function as query string.
I failed to fin any documentaion of that function.

Again , many thanks for your great support.





"Ashish M Bhonkiya" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi bredal Jensen,
>
> try this.
> MyRadio.Attributes.Add("onclick","__doPosback("+ info.ToString() +",'')");
>
> HTH
> Regards
> Ashish M Bhonkiya
>
> "bredal Jensen" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > I'm trying to generate a postback to the server when
> > my radio button is selected.
> >
> > This code MyRadio.Attributes.Add("onclick",__doPosback(info, '')) does
> > generate a javascript error.
> > Info is an integer value i need to send to my server in the query string
> > ....
> > Can someone help me with this?
> >
> > Thanks
> >
> >

>
>



 
Reply With Quote
 
bredal Jensen
Guest
Posts: n/a
 
      04-27-2004
Well , i just found out that i may not need javascript to accomplish this.

I could use the following:


MyRadio.AutoPostBack = true;

I also think this solution should be more appropriate for my problem.
Now , the problem how do i define the message handler when my "click"
generate a postback.

I tried :

MyRadio.Attribute.Add("onclick","MyClcick_handler" );


But it does not seem to do the magic.


Any idea?






"bredal Jensen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> That worked great..
> By the way, how many different parameters can one send in the __DoPostBack
> function as query string.
> I failed to fin any documentaion of that function.
>
> Again , many thanks for your great support.
>
>
>
>
>
> "Ashish M Bhonkiya" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi bredal Jensen,
> >
> > try this.
> > MyRadio.Attributes.Add("onclick","__doPosback("+ info.ToString()

+",'')");
> >
> > HTH
> > Regards
> > Ashish M Bhonkiya
> >
> > "bredal Jensen" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > >
> > > I'm trying to generate a postback to the server when
> > > my radio button is selected.
> > >
> > > This code MyRadio.Attributes.Add("onclick",__doPosback(info, '')) does
> > > generate a javascript error.
> > > Info is an integer value i need to send to my server in the query

string
> > > ....
> > > Can someone help me with this?
> > >
> > > Thanks
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
bredal Jensen
Guest
Posts: n/a
 
      04-27-2004
Myradio is genearted dynamically and i can therefore not define
The click event handler in my aspx file.

"MyRadio.AutoPostBack = true" does in fact generate the
postback event.

I'm therefore temptaed to use delegates .

But if someone find a better solution then
i would be happy to know....


Thanks


"bredal Jensen" <(E-Mail Removed)> wrote in message
news:OTQ%(E-Mail Removed)...
> Well , i just found out that i may not need javascript to accomplish this.
>
> I could use the following:
>
>
> MyRadio.AutoPostBack = true;
>
> I also think this solution should be more appropriate for my problem.
> Now , the problem how do i define the message handler when my "click"
> generate a postback.
>
> I tried :
>
> MyRadio.Attribute.Add("onclick","MyClcick_handler" );
>
>
> But it does not seem to do the magic.
>
>
> Any idea?
>
>
>
>
>
>
> "bredal Jensen" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > That worked great..
> > By the way, how many different parameters can one send in the

__DoPostBack
> > function as query string.
> > I failed to fin any documentaion of that function.
> >
> > Again , many thanks for your great support.
> >
> >
> >
> >
> >
> > "Ashish M Bhonkiya" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi bredal Jensen,
> > >
> > > try this.
> > > MyRadio.Attributes.Add("onclick","__doPosback("+ info.ToString()

> +",'')");
> > >
> > > HTH
> > > Regards
> > > Ashish M Bhonkiya
> > >
> > > "bredal Jensen" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > >
> > > > I'm trying to generate a postback to the server when
> > > > my radio button is selected.
> > > >
> > > > This code MyRadio.Attributes.Add("onclick",__doPosback(info, ''))

does
> > > > generate a javascript error.
> > > > Info is an integer value i need to send to my server in the query

> string
> > > > ....
> > > > Can someone help me with this?
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Notes on the invalid Javascript in __doPostBack (Asp.Net 1.1) Granger Godbold ASP .Net 0 05-12-2004 07:22 AM
using javascript __doPostBack inside asp.net C# code-behind bredal Jensen MCAD 8 05-03-2004 03:32 PM
Lose state information when using __doPostBack from Javascript Adrian ASP .Net 1 04-26-2004 09:34 AM
__dopostback javascript problem Fredrik Elestedt ASP .Net 3 04-23-2004 12:31 AM
javascript:__doPostBack error Nikhil Patel ASP .Net 3 02-26-2004 10:15 PM



Advertisments