freelanceprogrammers.org Forum Index » ASP
Re: Web User control property issue .
Joined: 10 Jan 2006
Posts: 33
Re: Web User control property issue .
why not set the CSS style in an onClick event? You would have to change
this to a link button I think but it would work.
Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 |
travis.falls@...
-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of Arindam
Sent: Thursday, June 23, 2005 12:38 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: [AspNetAnyQuestionIsOk] Web User control property issue .
Hi Web User control champs,
I have a user control which have the follwing code, a server side table with
links of 7 pages,
this will be used from all 7 pages for navigation.
Now i want when user clicks on any link, some property of that particular
cell needs to get changed,
like example when i click on "About Us", in the cell i want to write
<asp:TableCell BorderStyle=Dotted>
<asp:HyperLink runat="server" NavigateUrl="../Aboutus.aspx"
ID="HyperLink1">About Us</asp:HyperLink>
</asp:TableCell>
other wise cell should be normal.
look at the table bellow.
i want write some property in ascx codebehind file.
which i need to change from the place the usercontrol being called.
<asp:Table id="Table2" runat="server" BorderWidth="1" CellPadding="1"
CellSpacing="1" Width="90%">
<asp:TableRow>
<asp:TableCell>
<asp:HyperLink NavigateUrl="../Index.aspx" id="HyperLink8"
runat="server">Home</asp:HyperLink>
</asp:TableCell>
<asp:TableCell>
<asp:HyperLink runat="server" NavigateUrl="../Aboutus.aspx"
ID="HyperLink1">About Us</asp:HyperLink>
</asp:TableCell>
<asp:TableCell>
<asp:HyperLink runat="server" NavigateUrl="../Ourjobs.aspx"
ID="Hyperlink3">Our Job</asp:HyperLink>
</asp:TableCell>
<asp:TableCell>
<asp:HyperLink runat="server" NavigateUrl="../Development.aspx"
ID="Hyperlink4">Development</asp:HyperLink>
</asp:TableCell>
<asp:TableCell>
<asp:HyperLink runat="server" NavigateUrl="../Marketing.aspx"
ID="Hyperlink5">Marketing</asp:HyperLink>
</asp:TableCell>
<asp:TableCell>
<asp:HyperLink runat="server" NavigateUrl="../Contactus.aspx"
ID="Hyperlink6">Contact Us</asp:HyperLink>
</asp:TableCell>
<asp:TableCell>
<asp:HyperLink runat="server" NavigateUrl="../Login.aspx"
ID="Hyperlink7">Login</asp:HyperLink>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
Thanks & Regards
Arindam
Web Designer & Developer
---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com
[Non-text portions of this message have been removed]
Yahoo! Groups Links
*************************************************************************
PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
Joined: 09 Jan 2006
Posts: 17
Re: Web User control property issue .
Hi Champs,
Pls look at the following problem .
Error I am getting
System.NullReferenceException: Object reference not set to an instance of an
object
pointing at objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
TopMenus objTopmenu=new TopMenus(); // here inatance is created sucessfully
//the below line giving error, where trying to set the Cells border width of
<asp:Table id="Table_Menu" runat="server"> of user control
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
// this step also i ahve done in Page_Load, of the page i am calling usercontrol
from
Control Ctl1= LoadControl("Include/TopMenus.ascx");
Page.Controls.Add(Ctl1);
Thanks & Regards
Arindam
Web Designer & Developer
---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for
FREE!
http://in.mail.yahoo.com
[Non-text portions of this message have been removed]
Joined: 09 Jan 2006
Posts: 17
Re: Web User control property issue .
Hi Champs,
Pls look at the following problem .
Error I am getting
System.NullReferenceException: Object reference not set to an instance
of an object
pointing at objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
TopMenus objTopmenu=new TopMenus(); // here inatance is created
sucessfully
//the below line giving error, where trying to set the Cells border
width of <asp:Table id="Table_Menu" runat="server"> of user control
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
// this step also i ahve done in Page_Load, of the page i am calling
usercontrol from
Control Ctl1= LoadControl("Include/TopMenus.ascx");
Page.Controls.Add(Ctl1);
Thanks & Regards
Arindam
Web Designer & Developer
Thanks & Regards
Arindam
Web Designer & Developer
---------------------------------
How much free photo storage do you get? Store your friends n family photos for
FREE with Yahoo! Photos.
http://in.photos.yahoo.com
[Non-text portions of this message have been removed]
Joined: 25 Jun 2005
Posts: 3
Re: Web User control property issue .
Try this to see what happens:
1) Remove these two lines from Page_Load()
TopMenus objTopmenu=new TopMenus();
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
2) Instead, rearrange the control load steps as
follows:
Control Ctl1= LoadControl("Include/TopMenus.ascx");
TopMenus objTopmenu = (TopMenus)c1
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
Page.Controls.Add(Ctl1);
Let us know how it goes.
--- Arindam <e_arindam@...> wrote:
>
> Hi Champs,
> Pls look at the following problem .
>
> Error I am getting
> System.NullReferenceException: Object reference not
> set to an instance
> of an object
>
> pointing at
>
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
>
>
>
>
>
> TopMenus objTopmenu=new TopMenus(); // here inatance
> is created
> sucessfully
>
> //the below line giving error, where trying to set
> the Cells border
> width of <asp:Table id="Table_Menu" runat="server">
> of user control
>
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
>
>
> // this step also i ahve done in Page_Load, of the
> page i am calling
> usercontrol from
> Control Ctl1= LoadControl("Include/TopMenus.ascx");
> Page.Controls.Add(Ctl1);
>
>
>
> Thanks & Regards
>
> Arindam
> Web Designer & Developer
>
>
>
>
>
>
>
> Thanks & Regards
>
> Arindam
> Web Designer & Developer
>
>
>
>
>
> ---------------------------------
> How much free photo storage do you get? Store your
> friends n family photos for FREE with Yahoo! Photos.
>
> http://in.photos.yahoo.com
>
> [Non-text portions of this message have been
> removed]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Joined: 09 Jan 2006
Posts: 17
Re: Web User control property issue .
Hi,
Thanks Guys ,
Thanks to Mark, Charlescaroll, and you,
Yesterday i have solved the problem.
thanks a lot
Ying Jin <yingjin_us@...> wrote:
Try this to see what happens:
1) Remove these two lines from Page_Load()
TopMenus objTopmenu=new TopMenus();
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
2) Instead, rearrange the control load steps as
follows:
Control Ctl1= LoadControl("Include/TopMenus.ascx");
TopMenus objTopmenu = (TopMenus)c1
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
Page.Controls.Add(Ctl1);
Let us know how it goes.
--- Arindam wrote:
>
> Hi Champs,
> Pls look at the following problem .
>
> Error I am getting
> System.NullReferenceException: Object reference not
> set to an instance
> of an object
>
> pointing at
>
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
>
>
>
>
>
> TopMenus objTopmenu=new TopMenus(); // here inatance
> is created
> sucessfully
>
> //the below line giving error, where trying to set
> the Cells border
> width of
> of user control
>
objTopmenu.Table_Menu.Rows[1].Cells[1].BorderWidth=2;
>
>
> // this step also i ahve done in Page_Load, of the
> page i am calling
> usercontrol from
> Control Ctl1= LoadControl("Include/TopMenus.ascx");
> Page.Controls.Add(Ctl1);
>
>
>
> Thanks & Regards
>
> Arindam
> Web Designer & Developer
>
>
>
>
>
>
>
> Thanks & Regards
>
> Arindam
> Web Designer & Developer
>
>
>
>
>
> ---------------------------------
> How much free photo storage do you get? Store your
> friends n family photos for FREE with Yahoo! Photos.
>
> http://in.photos.yahoo.com
>
> [Non-text portions of this message have been
> removed]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Yahoo! Groups Links
Thanks & Regards
Arindam
Web Designer & Developer
---------------------------------
How much free photo storage do you get? Store your friends n family photos for
FREE with Yahoo! Photos.
http://in.photos.yahoo.com
[Non-text portions of this message have been removed]
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







