Dynamically assign QueryString to SRC?
-
I have an , I need X to be a string variable that each time it is generated by a method : void generateX(Obj sender, EventArgs e) { X="sth";} But when I assign <iframe src="sample.aspx?id=<%=X %>" />, it does not work? How I can pass X value to src of iframe? Chris#</x-turndown>
-
I have an , I need X to be a string variable that each time it is generated by a method : void generateX(Obj sender, EventArgs e) { X="sth";} But when I assign <iframe src="sample.aspx?id=<%=X %>" />, it does not work? How I can pass X value to src of iframe? Chris#</x-turndown>
make your generateX() routine return a string, and use <iframe src="sample.aspx?id=<%= generateX() %>" /> And why do you have the parameters on generateX? -- David Wengier Sonork ID: 100.14177 - Ch00k
-
make your generateX() routine return a string, and use <iframe src="sample.aspx?id=<%= generateX() %>" /> And why do you have the parameters on generateX? -- David Wengier Sonork ID: 100.14177 - Ch00k
GenerateX() method has to be void, since it gets called by a listBox control: onSelectedIndexChanged="GenerateX". This purpose of this method is to generate a sqlWhereClause, X is a public variable I defined in top (outside of this method), and I intended to use X value to pass to an url as querystring. It seems that use my method does not give me anything. But if view source of the web page, I can see the values replaced x in the spot. Then I tried to put IFrameName.src=".." in GenerateX() method, it said src is not found. How I can make a method return string while I need to have this void function to correspond to an ListBox onChange event? Any thought may enlight me ! Thanks in advance. Chris#</x-turndown>
-
GenerateX() method has to be void, since it gets called by a listBox control: onSelectedIndexChanged="GenerateX". This purpose of this method is to generate a sqlWhereClause, X is a public variable I defined in top (outside of this method), and I intended to use X value to pass to an url as querystring. It seems that use my method does not give me anything. But if view source of the web page, I can see the values replaced x in the spot. Then I tried to put IFrameName.src=".." in GenerateX() method, it said src is not found. How I can make a method return string while I need to have this void function to correspond to an ListBox onChange event? Any thought may enlight me ! Thanks in advance. Chris#</x-turndown>
Chris# wrote: I can see the values replaced x in the spot. If the value is being inserted into the page properly, but not being passed to the sample.aspx page, then maybe you need to HTMLEncode it first. -- David Wengier Sonork ID: 100.14177 - Ch00k