POST in asp.NET page without nesting forms

if (!IsPostBack)
            {
ScriptManager.RegisterStartupScript(Page, this.GetType(), "postback", "function doExternalPost(targetUrl) { theForm.__VIEWSTATE.value = ”; theForm.encoding = ‘application/x-www-form-urlencoded’; theForm.action = targetUrl; theForm.submit(); }", true);
        }   
           
litText.Text = string.Format("<input type=’hidden’ name=’postInfo’ value=’{0}’></input><a onclick=\"javascript:doExternalPost(‘{1}’);\" >clickme</a>", "prodABC" , "postURL");
               
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s