switch(Request.QueryString("handler")) in .Net?

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

Davíð Þórisson

hi
in my old Asp pages I used Jscript as below that is a single .asp page would
contain various subcodes. Is it the same in Asp.net?

switch (Request.QueryString("handler").Item)
{
case "load":
...
break
case "save":
...
break
}
 
nope.. you dont have to depend on those query string / post variables to do
most of the things.... specially deciding what your script (its a class
now... so your object ) does next.
Instead you use web contols like say image button or button and you use the
on click server side event handler to write the code for each....

if you are using code behind and using VS.net... just double click the html
page... that will take you to the load event of your class....

if you double click say the button... it will bind the event handler with
the right delegate and give you a event handler like it used to in VB.
if that button was submit button.. then you write the code to submit the
data...
if it was cancel.. you just redirect the user... stuff like that....

get yourself a good book on asp.net..... and welcome to the world of object
oriented web programming...
 
Back
Top