Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Can Href raise an event?

Reply
Thread Tools

Can Href raise an event?

 
 
Michael Tissington
Guest
Posts: n/a
 
      05-06-2004
What is the best way of doing this ....

In my Page_Load event I am building a table with a number of <a> tags.

On the page I have a Text box control.

When the user clicks one of the <a> tags and they get href to another page
and then want to access the value of the Text box control.

Any ideas how to do this please?


--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com


 
Reply With Quote
 
 
 
 
Garett Rogers
Guest
Posts: n/a
 
      05-07-2004
One way to do this would be the following:
<a href="javascript:void(0);"
onclick="window.location.href='/destination/path.aspx?textboxvalue=' +
document.getElementById('TextBox1').value;">text link</a>

Then in the destination page, you can access the value of the text box by
using Request.Querystring.Item("textboxvalue") in the codebehind

Hope this helps,
Garett

http://www.aimx.com
There's no place like 127.0.0.1

"Michael Tissington" <> wrote in message
news:%...
> What is the best way of doing this ....
>
> In my Page_Load event I am building a table with a number of <a> tags.
>
> On the page I have a Text box control.
>
> When the user clicks one of the <a> tags and they get href to another page
> and then want to access the value of the Text box control.
>
> Any ideas how to do this please?
>
>
> --
> Michael Tissington
> http://www.oaklodge.com
> http://www.tabtag.com
>
>



 
Reply With Quote
 
 
 
 
Michael Tissington
Guest
Posts: n/a
 
      05-07-2004
Thanks - this is what I'm looking for but will this work with both IE and
Netscape ?

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com

"Garett Rogers" <> wrote in message
news:...
> One way to do this would be the following:
> <a href="javascript:void(0);"
> onclick="window.location.href='/destination/path.aspx?textboxvalue=' +
> document.getElementById('TextBox1').value;">text link</a>
>
> Then in the destination page, you can access the value of the text box by
> using Request.Querystring.Item("textboxvalue") in the codebehind
>
> Hope this helps,
> Garett
>
> http://www.aimx.com
> There's no place like 127.0.0.1
>
> "Michael Tissington" <> wrote in message
> news:%...
> > What is the best way of doing this ....
> >
> > In my Page_Load event I am building a table with a number of <a> tags.
> >
> > On the page I have a Text box control.
> >
> > When the user clicks one of the <a> tags and they get href to another

page
> > and then want to access the value of the Text box control.
> >
> > Any ideas how to do this please?
> >
> >
> > --
> > Michael Tissington
> > http://www.oaklodge.com
> > http://www.tabtag.com
> >
> >

>
>



 
Reply With Quote
 
Bruno Sirianni
Guest
Posts: n/a
 
      05-07-2004
for nescape you can replace document.getElementById('TextBox1').value with
document.all['TextBox1'].value.

other solution is :
in table you can insert LinkButton instead <a/> tag. Add an event handler
for click, or better command, and do this work inside this.

private void link_click(object s, EventArgs e)
{
.....
Response.Redirect(".......aspx?val=" + TextBox1.Text);
}

Brun

"Michael Tissington" <> wrote in message
news:...
> Thanks - this is what I'm looking for but will this work with both IE and
> Netscape ?
>
> --
> Michael Tissington
> http://www.oaklodge.com
> http://www.tabtag.com
>
> "Garett Rogers" <> wrote in message
> news:...
> > One way to do this would be the following:
> > <a href="javascript:void(0);"
> > onclick="window.location.href='/destination/path.aspx?textboxvalue=' +
> > document.getElementById('TextBox1').value;">text link</a>
> >
> > Then in the destination page, you can access the value of the text box

by
> > using Request.Querystring.Item("textboxvalue") in the codebehind
> >
> > Hope this helps,
> > Garett
> >
> > http://www.aimx.com
> > There's no place like 127.0.0.1
> >
> > "Michael Tissington" <> wrote in message
> > news:%...
> > > What is the best way of doing this ....
> > >
> > > In my Page_Load event I am building a table with a number of <a> tags.
> > >
> > > On the page I have a Text box control.
> > >
> > > When the user clicks one of the <a> tags and they get href to another

> page
> > > and then want to access the value of the Text box control.
> > >
> > > Any ideas how to do this please?
> > >
> > >
> > > --
> > > Michael Tissington
> > > http://www.oaklodge.com
> > > http://www.tabtag.com
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Vidar Petursson
Guest
Posts: n/a
 
      05-14-2004
Hi

Nop document.all is IE only...

This should work on most browsers

document.forms["FORMNAME"].ELEMENTNAME.value

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"Bruno Sirianni" <> wrote in message
news:U5Umc.160102$...
> for nescape you can replace document.getElementById('TextBox1').value with
> document.all['TextBox1'].value.
>
> other solution is :
> in table you can insert LinkButton instead <a/> tag. Add an event handler
> for click, or better command, and do this work inside this.
>
> private void link_click(object s, EventArgs e)
> {
> .....
> Response.Redirect(".......aspx?val=" + TextBox1.Text);
> }
>
> Brun
>
> "Michael Tissington" <> wrote in message
> news:...
>> Thanks - this is what I'm looking for but will this work with both IE and
>> Netscape ?
>>
>> --
>> Michael Tissington
>> http://www.oaklodge.com
>> http://www.tabtag.com
>>
>> "Garett Rogers" <> wrote in message
>> news:...
>> > One way to do this would be the following:
>> > <a href="javascript:void(0);"
>> > onclick="window.location.href='/destination/path.aspx?textboxvalue=' +
>> > document.getElementById('TextBox1').value;">text link</a>
>> >
>> > Then in the destination page, you can access the value of the text box

> by
>> > using Request.Querystring.Item("textboxvalue") in the codebehind
>> >
>> > Hope this helps,
>> > Garett
>> >
>> > http://www.aimx.com
>> > There's no place like 127.0.0.1
>> >
>> > "Michael Tissington" <> wrote in message
>> > news:%...
>> > > What is the best way of doing this ....
>> > >
>> > > In my Page_Load event I am building a table with a number of <a>
>> > > tags.
>> > >
>> > > On the page I have a Text box control.
>> > >
>> > > When the user clicks one of the <a> tags and they get href to another

>> page
>> > > and then want to access the value of the Text box control.
>> > >
>> > > Any ideas how to do this please?
>> > >
>> > >
>> > > --
>> > > Michael Tissington
>> > > http://www.oaklodge.com
>> > > http://www.tabtag.com
>> > >
>> > >
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Hüseyin Bilkut Şıhmanoğlu
Guest
Posts: n/a
 
      05-23-2004
use linkbutton instead to rise an event
"Michael Tissington" <> wrote in message
news:#...
> What is the best way of doing this ....
>
> In my Page_Load event I am building a table with a number of <a> tags.
>
> On the page I have a Text box control.
>
> When the user clicks one of the <a> tags and they get href to another page
> and then want to access the value of the Text box control.
>
> Any ideas how to do this please?
>
>
> --
> Michael Tissington
> http://www.oaklodge.com
> http://www.tabtag.com
>
>



 
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
Raise X or Raise X()? bvdp Python 10 03-12-2012 04:08 PM
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
raise Exception or raise Exception() ernest Python 2 11-14-2010 08:14 PM
raise or not to raise [Newbie] Jacol Python 5 02-05-2007 11:46 PM
Can Href raise an event? Michael Tissington ASP .Net 7 05-23-2004 12:13 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57