Subbu
Subbu

Reputation: 3299

how can we pass the variable into the function via url?

I have designed an ASP.NET page which create graphs.

I have written a class file (which contain a function to render the graph, a function for entering data named insertdata(string[] s,double[] d)) in App_code folder.

I pass the value into the insertdata during page_load event.

I saw a feature of googlechart where you pass the value via URL it will create a graph according to that passed value.

How can i pass the value into the insertdata() function through the URL?

Upvotes: 1

Views: 1043

Answers (2)

Fermin
Fermin

Reputation: 36071

Here is some more info on QueryStrings,

http://www.java2s.com/Code/ASP/Request/SendandgetquerystringC.htm

Google it and you'll find lots of information.

Upvotes: 0

Coding Flow
Coding Flow

Reputation: 21881

Use the Request.QueryString. e.g.

http://www.somesite.com/somepage.aspx?mayvar=someval

With the above URL

Request.QueryString["myvar"]

in the codebehind for somepage.aspx the above will return "someval" ;

Upvotes: 3

Related Questions