By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,826 Members | 815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,826 IT Pros & Developers. It's quick & easy.

Position

P: n/a
How to change the position of webservercontrol at runtime

Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
JavaScript, CSS.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"sara" <sa**@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
How to change the position of webservercontrol at runtime

Nov 19 '05 #2

P: n/a
By runtime I assume you mean on the client using javascript. Without any
specific example, it's hard to say, but let's try:

<asp:TextBox id="name" Runat="server" />
<input type="button" onclick="move();" value="move" />

<script language="javascript">
function move(){
var btn = document.getElementById('<%=name.ClientId%>');
if (btn){
btn.style.position = 'relative';
btn.style.top = '200;x';
btn.style.left = '300px';
}
}
</script>

get a javascript reference to the control you want to move. set the
position to relative, and position it where you want.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"sara" <sa**@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
How to change the position of webservercontrol at runtime

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.