see docs for explanation:
but you can use the clientidmode to change this behavior:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I using name of input type file like this
but when i display on web it's changed to this
how can I delete this ctl00$ContentPlaceHolder1$?
see docs for explanation:
but you can use the clientidmode to change this behavior:
As noted, just add clientidmode="static".
However, that will fix (result) in the id NOT be changed. I beyond often do this all the time when using jQuery selectors, and then to select your button or whatever then you can go
myBtn = $('#posting')
And above will work. However, it NOT at all clear why you using/need "name". asp.net will munge that up for you, and clientidmode will NOT stop the .net system from changing the "name".
But, you can force/fix/freeze this for "id" and a simple adding of clientidmode="static" will fix this issue.
Hence this:
<input class="contain_data" runat="server" type="file" name="posting"
id="posting"
clientidmode="static" />
Hi @Lộc Đào ,
WebForms should only override the server
control's ID,
the runat="server" attribute, to indicate that it's a server
control (rather than static HTML).
I noticed that you already use <form method="post">
to send form data, you just need to remove runat="server"
.
Of course, if you need runat="server", you can use the clientidmode="static" mentioned above.
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.