need help with a dnnModal in a module
Last Post 05/02/2013 3:44 PM by steve. 1 Replies.
Author Messages
steve
Nuker
Nuker
Posts:14


--
05/02/2013 2:05 PM  
Hi,

I'm working on a module with a textbox and a button after the button is clicked and the textbox has got input I want to show a dnnModal box.

I first try to put the code behind the onclick from the button the popup shows but then how do I get the value from the textbox to include in my querystring.

Then I try to do a postback on the button and register the script like so:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"popup","dnnModal.show('" + url + "',false,300,650,false);");

But no popup if i copy and paste the code in ie develop tools it shows.

What is the best way to do this what am I missing?

Thanks
steve
Nuker
Nuker
Posts:14


--
05/02/2013 3:44 PM  
Ok found it a bug in my code

this is the code:
var javaScriptText = new StringBuilder();
javaScriptText.Append("<script type=\"text/javascript\"> function onNeroClickButton() { "); <br /> javaScriptText.Append(string.Format("var control = document.getElementById('{0}'); ", this.txtInput.ClientID)); <br /> javaScriptText.Append(string.Format("var url = '{0}?popUp=true&code=' + control.value ;", url)); <br /> javaScriptText.Append("return dnnModal.show(url,/*showReturn*/true,300,650,true,''); } </"); <br /> javaScriptText.Append("script>"); <br /> <br /> Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "popupnero", javaScriptText.ToString());


---