C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Setting User control properties contd with the HTML


Posted Date: 04 Nov 2004    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: SattyMember Level: Gold    
Rating: 1 out of 5Points: 10



Sorry guys due to some reasons the page has not allowed me to type the HTML.I believe the HTML will show this time.
The HTML for that is given below:

<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TestControl.ascx.cs" Inherits="UCTest.TestControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

< asp:Panel id="Panel1" runat="server" style="POSITION: absolute; Left:910px; TOP:208px">

< asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 136px; POSITION: absolute; TOP: 64px" runat="server" Text="Button 1"> < /asp:Button>
< asp:Button id="Button2" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 64px" runat="server" Text="Button 2"> < /asp:Button>
< asp:Label id="lblOutput" style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 24px" runat="server"
Width="248px">UserControl: UCTest< /asp:Label>
< /asp:Panel>


But my task is to strip off the left and top in the style attribute of the panel and set the values dynamically.

so to do that we need to write a property of the user control and apply it to all the pages which are using the user control.

First of all i need to take off the left and top values from the HTML and set position as "relative"

<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TestControl.ascx.cs" Inherits="UCTest.TestControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

< asp:Panel id="Panel1" runat="server" style="POSITION:relative; ">

< asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 136px; POSITION: absolute; TOP: 64px" runat="server" Text="Button 1"> < /asp:Button>
< asp:Button id="Button2" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 64px" runat="server" Text="Button 2"> < /asp:Button>
< asp:Label id="lblOutput" style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 24px" runat="server"
Width="248px">UserControl: UCTest< /asp:Label>
< /asp:Panel>







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Setting the User Control Properties at runtime
Previous Resource: Step By Step approach to disable Right Button Click in ASP.NET
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use