Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass Paramerer To Web Form
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
01450276
Message ID:
01450310
Vues:
48
>>On my main form I have a treeview. When a tree node link is clicked I want to open another form, passing some data to the second form.
>>
>>I have the NavigateURL property of the node set tp the name of the second page, and the second page opens fine when I click the node. I just need to know how to pass a value to the second page.
>
>Depending on the amount and type of information you can just pass it in the URL, ex:
>
>
>// If your URL was this:
>// http://www.levelextreme.com/MyNewPage.aspx?ParameterName=ParameterValue
>
>// You can access the value from the new page using code like this:
>// The ?? stuff basically just returns the "" portion if Request.QueryString["ParameterName"] returns null 
>// (for example, it wasn't passed in)
>string paramValue = Request.QueryString["ParameterName"] ?? "";
>
Or you can put it in a Session variable..

In calling form..
Session("MyVariableName") = MyvariableName

in called form..

Dim MyVariableName as myvariabletype = ctype(session("MyVariableName"), myVariableType)

Either method works. Passing via QueryString is cleaner but is limited in type. Passing via Session will pass most anything, but it does take memory and should be cleaned up when possible (ie Session.Remove("MyVariableName")).
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform