开发者

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

开发者 https://www.devze.com 2022-12-30 12:05 出处:网络
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)) i

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 ins开发者_如何学编程ertdata() function through the URL?


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" ;


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号