whykeepderegingme
Programmer
hey, before i get deregistered randomly for the 3rd time, I have a question.
I am converting a system from ASP to ASP.NET. Our current system uses include files extensively. For example, each page includes LanguageManagerINC.asp. In LanguageManagerINC.asp, we include LanguageVars.asp, which contains a set of variable declarations, and we look at a cookie to see if language is set to 0 or 1 (english/french), and include the appropriate definition file, LanguageEnglish.asp or LanguageFrench.asp.
So,
LanguageManagerINC.asp looks like this:
<%
Dim strLang
strLang = Request.Cookies("language")
%>
<!-- #include file="ve_LanguageManager.asp" -->
<%If strLang = "1" Then%>
<!-- #include file="ve_LanguageFrench.asp" -->
<%Else%>
<!-- #include file="ve_LanguageEnglish.asp" -->
<%End If%>
LanguageVars looks like this:
<%
dim userName
dim password
...
%>
LanguageEnglish looks like this:
<%
userName = "Enter username here"
password = "Enter password here"
%>
Then, those variables are used in the pages as labels, so a page might have <%=userName%> in it, whose value will depend on whether the cookie stored english or french as the preferred language.
Now we are using C#, and I'm lost as to where to start. I have got it sort of working with a user control, I can use <%=myControl.userName%>, but I can't use it in conjunction with a server control, such as an asp:Button. I thought I would be able to do:
<asp:Button ID="submit" Runat="server" Text=<%=myControl.userName%>></asp:Button>
But this gives me an error, saying I can't use <% %> with a server control. GRRRRRRRRRRRRR...
I am converting a system from ASP to ASP.NET. Our current system uses include files extensively. For example, each page includes LanguageManagerINC.asp. In LanguageManagerINC.asp, we include LanguageVars.asp, which contains a set of variable declarations, and we look at a cookie to see if language is set to 0 or 1 (english/french), and include the appropriate definition file, LanguageEnglish.asp or LanguageFrench.asp.
So,
LanguageManagerINC.asp looks like this:
<%
Dim strLang
strLang = Request.Cookies("language")
%>
<!-- #include file="ve_LanguageManager.asp" -->
<%If strLang = "1" Then%>
<!-- #include file="ve_LanguageFrench.asp" -->
<%Else%>
<!-- #include file="ve_LanguageEnglish.asp" -->
<%End If%>
LanguageVars looks like this:
<%
dim userName
dim password
...
%>
LanguageEnglish looks like this:
<%
userName = "Enter username here"
password = "Enter password here"
%>
Then, those variables are used in the pages as labels, so a page might have <%=userName%> in it, whose value will depend on whether the cookie stored english or french as the preferred language.
Now we are using C#, and I'm lost as to where to start. I have got it sort of working with a user control, I can use <%=myControl.userName%>, but I can't use it in conjunction with a server control, such as an asp:Button. I thought I would be able to do:
<asp:Button ID="submit" Runat="server" Text=<%=myControl.userName%>></asp:Button>
But this gives me an error, saying I can't use <% %> with a server control. GRRRRRRRRRRRRR...