.NETGURU
Pass a value to an ASCX file?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreuse' list.


Damian Barrow
Can I?
I have an ascx which does a database query and then displays the results
in a templated datareader.
Part of my sql is

where month(hol_date) = month(dateAdd(m,1,getDate()))

What I really want to do is
<%@ Register TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=1" %>
<%@ Register TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=2" %>
<%@ Register TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=3" %>

then in the ascx sql put " Where month(dd) = " &
querystring("theMonth").value (pseudo code)
but obviously this isn't working.

I currently have an ASPX of ..
<%@ Page Language="vb" Explicit="True" EnableSessionState="True"
smartnavigation="True" %>
<%@ Register TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest1.ascx" %>

<html>
<head>
<title>test ascx's</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<asp:label runat="server" id="mthID" Visible="True"
text="8"></asp:label><br>
<thisMonthsDeals1:thisMonthsBIT1 id="myUC1" runat="server" />
</body>
</html>

And my ascx is
<%@ Control Language="vb"%>
<asp:label id="monthID" text="8" runat="server"></asp:label>

How do I get my label to display the month passed in?

Cheers
Damian
Reply to this message...
 
    
James Avery
Can I?
I have an ascx which does a database query and then displays the results
in a templated datareader. Part of my sql is where month(hol_date)
= month(dateAdd(m,1,getDate())) What I really want to do is <%@
Register TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=1" %> <%@ Register
TagPrefix="thisMonthsDeals1" TagName="thisMonthsDeals1""
Src="/get_Cheapest.ascx?THEMONTH=2" %> <%@ Register
TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=3" %> then in the ascx sql put
" Where month(dd) = " & querystring("theMonth").value (pseudo code)
but obviously this isn't working. I currently have an ASPX of ..
<%@ Page Language="vb" Explicit="True" EnableSessionState="True"
smartnavigation="True" %> <%@ Register TagPrefix="thisMonthsDeals1"
TagName="thisMonthsBit1" Src="/get_Cheapest1.ascx" %> <html>
<head> <title>test ascx's</title> <meta http-equiv="Content-Type"
content="text/html; �harset=iso-8859-1"> </head> <body> <asp:label
runat="server" id="mthID" Visible="True"
text="8"></asp:label><br> <thisMonthsDeals1:thisMonthsBIT1
id="myUC1" runat="server" />
| [aspngreuse] member Click here to reveal e-mail address �OUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp �OIN/QUIT
</BODY>
</html>

And my ascx is
<%@ Control Language="vb"%>
<asp:label id="monthID" text="8" runat="server"></asp:label>
How do I get my label to display the month passed in?
Cheers Damian
Reply to this message...
 
    
Damian Barrow
Can I?
I have an ascx which does a database query and then displays the results
in a templated datareader. Part of my sql is =20 where month(hol_date)
=3D month(dateAdd(m,1,getDate())) =20 What I really want to do is <%@
Register TagPrefix=3D"thisMonthsDeals1" TagName=3D"thisMonthsBit1"
Src=3D"/get_Cheapest.ascx?THEMONTH=3D1" %> <%@ Register
TagPrefix=3D"thisMonthsDeals1" TagName=3D"thisMonthsDeals1""
Src=3D"/get_Cheapest.ascx?THEMONTH=3D2" %> <%@ Register
TagPrefix=3D"thisMonthsDeals1" TagName=3D"thisMonthsBit1"
Src=3D"/get_Cheapest.ascx?THEMONTH=3D3" %> =20 then in the ascx sql put
" Where month(dd) =3D " & querystring("theMonth").value (pseudo code)
but obviously this isn't working. =20 I currently have an ASPX of ..
<%@ Page Language=3D"vb" Explicit=3D"True" EnableSessionState=3D"True"
smartnavigation=3D"True" %> <%@ Register TagPrefix=3D"thisMonthsDeals1"
TagName=3D"thisMonthsBit1" Src=3D"/get_Cheapest1.ascx" %> =20 <html>
<head> <title>test ascx's</title> <meta http-equiv=3D"Content-Type"
content=3D"text/html; = charset=3Diso-8859-1"> </head> <body> <asp:label
runat=3D"server" id=3D"mthID" Visible=3D"True"
text=3D"8"></asp:label><br> <thisMonthsDeals1:thisMonthsBIT1
id=3D"myUC1" runat=3D"server" />
| [aspngreuse] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp = JOIN/QUIT

| [aspngreuse] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp = JOIN/QUIT
</BODY>
</html>
=20
And my ascx is=20
<%@ Control Language=3D"vb"%>
<asp:label id=3D"monthID" text=3D"8" runat=3D"server"></asp:label> =20
How do I get my label to display the month passed in? =20 =20 =20 =20
Cheers Damian =20 =20
Reply to this message...
 
    
James Avery
Can I?
I have an ascx which does a database query and then displays the results
in a templated datareader. Part of my sql is where month(hol_date)
= month(dateAdd(m,1,getDate())) What I really want to do is <%@
Register TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=1" %> <%@ Register
TagPrefix="thisMonthsDeals1" TagName="thisMonthsDeals1""
Src="/get_Cheapest.ascx?THEMONTH=2" %> <%@ Register
TagPrefix="thisMonthsDeals1" TagName="thisMonthsBit1"
Src="/get_Cheapest.ascx?THEMONTH=3" %> then in the ascx sql put
" Where month(dd) = " & querystring("theMonth").value (pseudo code)
but obviously this isn't working. I currently have an ASPX of ..
<%@ Page Language="vb" Explicit="True" EnableSessionState="True"
smartnavigation="True" %> <%@ Register TagPrefix="thisMonthsDeals1"
TagName="thisMonthsBit1" Src="/get_Cheapest1.ascx" %> <html>
<head> <title>test ascx's</title> <meta http-equiv="Content-Type"
content="text/html; �harset=iso-8859-1"> </head> <body> <asp:label
runat="server" id="mthID" Visible="True"
text="8"></asp:label><br> <thisMonthsDeals1:thisMonthsBIT1
id="myUC1" runat="server" />
| [aspngreuse] member Click here to reveal e-mail address �OUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp �OIN/QUIT

| [aspngreuse] member Click here to reveal e-mail address �OUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp �OIN/QUIT

| [aspngreuse] member Click here to reveal e-mail address �OUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp �OIN/QUIT
</BODY>
</html>

And my ascx is
<%@ Control Language="vb"%>
<asp:label id="monthID" text="8" runat="server"></asp:label>
How do I get my label to display the month passed in?
Cheers Damian
Reply to this message...
 
 
System.Int32




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification