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.
精彩评论