ASP -> ASP.Net, using hyperlink actions

  • Thread starter Thread starter Davíð Þórisson
  • Start date Start date
D

Davíð Þórisson

sorry my lazyiness (for not Googling!), I'm looking for the .Net way to do
this classical asp setup (Jscript)...

<a href="page.asp?action=do1">bla bla1</a>
<a href="page.asp?action=do2">bla bla2</a>
...


-------- and correspondingly:

switch (Request.QueryString("action"))
{
case "do1"
...
break

case "do2"
...
break
}



I suspect I should be using LinkButton server control... is that correct?
 
1) requires JavaScript on client side
2) must be inside a form element!!!
 
sorry for not putting this whole lot in the first post but...

the thing is I don't need the view state, I'm just browsing pages... (aka
GET method, not POST)

Am I maybe misunderstanding something?
 
no. the linkbutton uses javascript to do the postback. I'd stick with the
classic approach.

-- bruce (sqlwork.com)
 
For this basic functionality, just create your links like you did then
respond in your Page_Load event handler and check the Request.QueryString
collection.
 
Back
Top