|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Input fields are renamed with runat="server", how do I change itHello,
I have a webform which needs to post to PayPal. One of the elements is a hidden field which I am populating with a value from the URL. In order to do this, I have to use runat="server'. But when I do, ASP.NET will rename the field. The field needs to be named "custom" so PayPal will know what to do with it. How can I prevent this, or what can I do? Thanks, James Can't reproduce this. Which version of .NET are you using?
Axel Dahmen --------------- Show quoteHide quote "jamessmb" <james***@discussions.microsoft.com> schrieb im Newsbeitrag news:D1EE254F-4673-4338-BD7A-8D313E583908@microsoft.com... > Hello, > > I have a webform which needs to post to PayPal. One of the elements is a > hidden field which I am populating with a value from the URL. In order to do > this, I have to use runat="server'. But when I do, ASP.NET will rename the > field. The field needs to be named "custom" so PayPal will know what to do > with it. > > How can I prevent this, or what can I do? > Thanks, > James Hi,
I'm using version 2 create an input field like this: <input type="hidden" id="custom" name="custom" value="" runat="server" /> What is rendered is this: <input name="ctl00$ctl00$SiteContentPlaceHolder$CenterColumn$custom" type="hidden" id="ctl00_ctl00_SiteContentPlaceHolder_CenterColumn_custom" /> I actually did find a workaround with Javascript, since the "custom" variable is passed in the query string to this page: var uName = document.location.search; var uNameArr = uName.split("="); document.getElementById('custom').value = uNameArr[1]; However, I still would like to know how to deal with this. It seems to me there should be a way to keep the name. Thanks, James Show quoteHide quote "Axel Dahmen" wrote: > Can't reproduce this. Which version of .NET are you using? > > Axel Dahmen > > --------------- > "jamessmb" <james***@discussions.microsoft.com> schrieb im Newsbeitrag > news:D1EE254F-4673-4338-BD7A-8D313E583908@microsoft.com... > > Hello, > > > > I have a webform which needs to post to PayPal. One of the elements is a > > hidden field which I am populating with a value from the URL. In order to > do > > this, I have to use runat="server'. But when I do, ASP.NET will rename the > > field. The field needs to be named "custom" so PayPal will know what to do > > with it. > > > > How can I prevent this, or what can I do? > > Thanks, > > James > > > You could subclass HtmlInputHidden (or whatever that thing is called;
there's 2 similarly-named ones, and I can never remember which is which) and override ClientID and UniqueID, but that behavior is otherwise by design, as it needs to prepend the control tree before the name/ID so that two identically-named fields (gets common with user controls) don't "collide"
detailsview,
CreateChildControls() always returns default property values 3-Tier Binding Problem ????????? Menu Control DataGrid dynamic columns / firing events ObjectDataSource button's OnClick event runs after page databinding... Accessing Datagrid Cells on OnClick Postback Problem Retrieving Values from CheckboxList nested inside Datalist Control Where is the onclick event? |
|||||||||||||||||||||||