Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

ASP.NET Authentication Error Message

Guest
Aug 29, 2006 Aug 29, 2006

Copy link to clipboard

Copied

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Value'

Source Error:




Line 26: {
Line 27: // authenticate user
Line 28: if ((txt_Login.Value == ds_Login.FieldValue("Agent_Login",null)) &&
Line 29: (txt_Password.Value == ds_Login.FieldValue("Agent_Password",null)))
Line 30: {






Here’s my actual page code:



<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>

<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>

<MM:DataSet

runat="Server"

id="ds_Login"

IsStoredProcedure="true"

CreateDataSet="true"

ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn_EMA"] %>'

DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn_EMA"] %>'

CommandText="EquityMax3.sp_Agent_Login"

Expression='<%# IsPostBack %>'

Debug="true"

>

<Parameters>

<Parameter Name="@Login" Value='<%# ((Request.Form["txt_Login"] != null) && (Request.Form["txt_Login"].Length > 0)) ? Request.Form["txt_Login"] : "" %>' Type="VarChar" Direction="Input" />

<Parameter Name="@Password" Value='<%# ((Request.Form["txt_Password"] != null) && (Request.Form["txt_Password"].Length > 0)) ? Request.Form["txt_Password"] : "" %>' Type="VarChar" Direction="Input" />

</Parameters>

</MM:DataSet>



<MM:PageBind runat="server" PostBackBind="true" />



<script runat="server">

protected void Page_Load(Object Src, EventArgs E)

{



if (IsPostBack)

{

// authenticate user

if ((txt_Login.Value == ds_Login.FieldValue("Agent_Login",null)) &&

(txt_Password.Value == ds_Login.FieldValue("Agent_Password",null)))

{

FormsAuthentication.RedirectFromLoginPage(txt_Login.Value, false);

}

else

{

lbl_Msg.Text = "Login Name or Password are incorrect. Please try again or call (858) 755-8333 for more information.";

}

}

}

</script>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns=" http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />



<title>Untitled Document</title>

</head>



<body

<table align="center" width="782" border="0" cellspacing="0" cellpadding="0">

<div id="standard_text">

<tr>

<td valign="top"><table width="782" border="0" cellspacing="0" cellpadding="0">

<tr>

<td colspan="3"><img src="../Site_Graphics/Body_Tan_Top.jpg" width="782" height="20" /></td>

</tr>

<tr>

<td width="13" background="../Site_Graphics/Shdw_Tan_Lft.jpg"> </td>

<td width="756" bgcolor="#CC9966">

<form runat="server" id="frm_Login" name="frm_Login" method="post" action="">

<table border="0" align="center">

<tr>

<td><p>Login Name</p></td>

<td><asp:textbox CssClass="frm_field" ID="txt_Login" runat="server" TextMode="SingleLine" Width="140" ></asp:textbox> </td>

</tr>

<tr>

<td><p>Password</p></td>

<td><asp:textbox CssClass="frm_field" ID="txt_Password" runat="server" TextMode="Password" Width="140" ></asp:textbox> </td>

</tr>

<tr>

<td> </td>

<td><asp:button ID="btn_Login" runat="server" Text="Login"></asp:button></td>

</tr>

</table>

<asp:Label ID="lbl_Msg" runat="server" ForeColor="#FF0000" />

</form> </td>

<td width="13" background="../Site_Graphics/Shdw_Tan_Rt.jpg"> </td>

</tr>

</table></td>

</tr>

</div>





</body>


Thanks bunches
TOPICS
Server side applications

Views

658
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2006 Aug 30, 2006

Copy link to clipboard

Copied

TextBox controls have a Text property you should be using with your ugly
unconventional code, i.e txt_Login.Text.
Reading documentation for simplistic syntax is usually a good idea ainna? Do
you want to become masterful as a developer?

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43�2'17"N 88�2'37"W : 43�2'17"N 88�2'37"W

"cyber_worker" <webforumsuser@macromedia.com> wrote in message
news:ed320v$dg3$1@forums.macromedia.com...
> Compilation Error
> Description: An error occurred during the compilation of a resource
> required
> to service this request. Please review the following specific error
> details and
> modify your source code appropriately.
>
> Compiler Error Message: CS0117: 'System.Web.UI.WebControls.TextBox' does
> not
> contain a definition for 'Value'
>
> Source Error:
>
>
>
>
> Line 26: {
> Line 27: // authenticate user
> Line 28: if ((txt_Login.Value ==
> ds_Login.FieldValue("Agent_Login",null)) &&
> Line 29: (txt_Password.Value ==
> ds_Login.FieldValue("Agent_Password",null)))
> Line 30: {
>
>
>
>
>
>
> Here?s my actual page code:
>
>
>
> <%@ Page Language="C#" ContentType="text/html"
> ResponseEncoding="iso-8859-1" %>
>
> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
> Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,cultu
> re=neutral" %>
>
> <MM:DataSet
>
> runat="Server"
>
> id="ds_Login"
>
> IsStoredProcedure="true"
>
> CreateDataSet="true"
>
> ConnectionString='<%#
> System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_con
> n_EMA"] %>'
>
> DatabaseType='<%#
> System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETY
> PE_conn_EMA"] %>'
>
> CommandText="EquityMax3.sp_Agent_Login"
>
> Expression='<%# IsPostBack %>'
>
> Debug="true"
>
> >
>
> <Parameters>
>
> <Parameter Name="@Login" Value='<%# ((Request.Form["txt_Login"] !=
> null)
> && (Request.Form["txt_Login"].Length > 0)) ? Request.Form["txt_Login"] :
> "" %>'
> Type="VarChar" Direction="Input" />
>
> <Parameter Name="@Password" Value='<%#
> ((Request.Form["txt_Password"] !=
> null) && (Request.Form["txt_Password"].Length > 0)) ?
> Request.Form["txt_Password"] : "" %>' Type="VarChar" Direction="Input"
> />
>
> </Parameters>
>
> </MM:DataSet>
>
>
>
> <MM:PageBind runat="server" PostBackBind="true" />
>
>
>
> <script runat="server">
>
> protected void Page_Load(Object Src, EventArgs E)
>
> {
>
>
>
> if (IsPostBack)
>
> {
>
> // authenticate user
>
> if ((txt_Login.Value ==
> ds_Login.FieldValue("Agent_Login",null)) &&
>
> (txt_Password.Value ==
> ds_Login.FieldValue("Agent_Password",null)))
>
> {
>
>
> FormsAuthentication.RedirectFromLoginPage(txt_Login.Value, false);
>
> }
>
> else
>
> {
>
> lbl_Msg.Text = "Login Name or Password
> are
> incorrect. Please try again or call (858) 755-8333 for more information.";
>
> }
>
> }
>
> }
>
> </script>
>
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns=" http://www.w3.org/1999/xhtml">
>
> <head>
>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>
>
>
> <title>Untitled Document</title>
>
> </head>
>
>
>
> <body
>
> <table align="center" width="782" border="0" cellspacing="0"
> cellpadding="0">
>
> <div id="standard_text">
>
> <tr>
>
> <td valign="top"><table width="782" border="0" cellspacing="0"
> cellpadding="0">
>
> <tr>
>
> <td colspan="3"><img src="../Site_Graphics/Body_Tan_Top.jpg"
> width="782" height="20" /></td>
>
> </tr>
>
> <tr>
>
> <td width="13"
> background="../Site_Graphics/Shdw_Tan_Lft.jpg"> </td>
>
> <td width="756" bgcolor="#CC9966">
>
> <form runat="server" id="frm_Login" name="frm_Login"
> method="post"
> action="">
>
> <table border="0" align="center">
>
> <tr>
>
> <td><p>Login Name</p></td>
>
> <td><asp:textbox CssClass="frm_field" ID="txt_Login"
> runat="server" TextMode="SingleLine" Width="140" ></asp:textbox>
> </td>
>
> </tr>
>
> <tr>
>
> <td><p>Password</p></td>
>
> <td><asp:textbox CssClass="frm_field" ID="txt_Password"
> runat="server" TextMode="Password" Width="140" ></asp:textbox>
> </td>
>
> </tr>
>
> <tr>
>
> <td> </td>
>
> <td><asp:button ID="btn_Login" runat="server"
> Text="Login"></asp:button></td>
>
> </tr>
>
> </table>
>
> <asp:Label ID="lbl_Msg" runat="server" ForeColor="#FF0000" />
>
>
> </form> </td>
>
> <td width="13"
> background="../Site_Graphics/Shdw_Tan_Rt.jpg"> </td>
>
> </tr>
>
> </table></td>
>
> </tr>
>
> </div>
>
>
>
>
>
> </body>
>
>
> Thanks bunches
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2006 Aug 30, 2006

Copy link to clipboard

Copied

"Keep away from people who try to belittle your ambitions. Small people
always do that, but the really great make you feel that you, too, can become
great."
-- Mark Twain

Ron

"clintonG" <csgallagher@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:ed4cag$30b$1@forums.macromedia.com...
> TextBox controls have a Text property you should be using with your ugly
> unconventional code, i.e txt_Login.Text.
> Reading documentation for simplistic syntax is usually a good idea ainna?
> Do you want to become masterful as a developer?
>
> <%= Clinton Gallagher
> NET csgallagher AT metromilwaukee.com
> URL http://clintongallagher.metromilwaukee.com/
> MAP 43�2'17"N 88�2'37"W : 43�2'17"N 88�2'37"W
>
> "cyber_worker" <webforumsuser@macromedia.com> wrote in message
> news:ed320v$dg3$1@forums.macromedia.com...
>> Compilation Error
>> Description: An error occurred during the compilation of a resource
>> required
>> to service this request. Please review the following specific error
>> details and
>> modify your source code appropriately.
>>
>> Compiler Error Message: CS0117: 'System.Web.UI.WebControls.TextBox' does
>> not
>> contain a definition for 'Value'
>>
>> Source Error:
>>
>>
>>
>>
>> Line 26: {
>> Line 27: // authenticate user
>> Line 28: if ((txt_Login.Value ==
>> ds_Login.FieldValue("Agent_Login",null)) &&
>> Line 29: (txt_Password.Value ==
>> ds_Login.FieldValue("Agent_Password",null)))
>> Line 30: {
>>
>>
>>
>>
>>
>>
>> Here?s my actual page code:
>>
>>
>>
>> <%@ Page Language="C#" ContentType="text/html"
>> ResponseEncoding="iso-8859-1" %>
>>
>> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
>> Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,cultu
>> re=neutral" %>
>>
>> <MM:DataSet
>>
>> runat="Server"
>>
>> id="ds_Login"
>>
>> IsStoredProcedure="true"
>>
>> CreateDataSet="true"
>>
>> ConnectionString='<%#
>> System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_con
>> n_EMA"] %>'
>>
>> DatabaseType='<%#
>> System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETY
>> PE_conn_EMA"] %>'
>>
>> CommandText="EquityMax3.sp_Agent_Login"
>>
>> Expression='<%# IsPostBack %>'
>>
>> Debug="true"
>>
>> >
>>
>> <Parameters>
>>
>> <Parameter Name="@Login" Value='<%# ((Request.Form["txt_Login"] !=
>> null)
>> && (Request.Form["txt_Login"].Length > 0)) ? Request.Form["txt_Login"] :
>> "" %>'
>> Type="VarChar" Direction="Input" />
>>
>> <Parameter Name="@Password" Value='<%#
>> ((Request.Form["txt_Password"] !=
>> null) && (Request.Form["txt_Password"].Length > 0)) ?
>> Request.Form["txt_Password"] : "" %>' Type="VarChar" Direction="Input"
>> />
>>
>> </Parameters>
>>
>> </MM:DataSet>
>>
>>
>>
>> <MM:PageBind runat="server" PostBackBind="true" />
>>
>>
>>
>> <script runat="server">
>>
>> protected void Page_Load(Object Src, EventArgs E)
>>
>> {
>>
>>
>>
>> if (IsPostBack)
>>
>> {
>>
>> // authenticate user
>>
>> if ((txt_Login.Value ==
>> ds_Login.FieldValue("Agent_Login",null)) &&
>>
>> (txt_Password.Value ==
>> ds_Login.FieldValue("Agent_Password",null)))
>>
>> {
>>
>>
>> FormsAuthentication.RedirectFromLoginPage(txt_Login.Value, false);
>>
>> }
>>
>> else
>>
>> {
>>
>> lbl_Msg.Text = "Login Name or
>> Password are
>> incorrect. Please try again or call (858) 755-8333 for more
>> information.";
>>
>> }
>>
>> }
>>
>> }
>>
>> </script>
>>
>>
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>
>> <html xmlns=" http://www.w3.org/1999/xhtml">
>>
>> <head>
>>
>> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
>> />
>>
>>
>>
>> <title>Untitled Document</title>
>>
>> </head>
>>
>>
>>
>> <body
>>
>> <table align="center" width="782" border="0" cellspacing="0"
>> cellpadding="0">
>>
>> <div id="standard_text">
>>
>> <tr>
>>
>> <td valign="top"><table width="782" border="0" cellspacing="0"
>> cellpadding="0">
>>
>> <tr>
>>
>> <td colspan="3"><img src="../Site_Graphics/Body_Tan_Top.jpg"
>> width="782" height="20" /></td>
>>
>> </tr>
>>
>> <tr>
>>
>> <td width="13"
>> background="../Site_Graphics/Shdw_Tan_Lft.jpg"> </td>
>>
>> <td width="756" bgcolor="#CC9966">
>>
>> <form runat="server" id="frm_Login" name="frm_Login"
>> method="post"
>> action="">
>>
>> <table border="0" align="center">
>>
>> <tr>
>>
>> <td><p>Login Name</p></td>
>>
>> <td><asp:textbox CssClass="frm_field" ID="txt_Login"
>> runat="server" TextMode="SingleLine" Width="140" ></asp:textbox>
>> </td>
>>
>> </tr>
>>
>> <tr>
>>
>> <td><p>Password</p></td>
>>
>> <td><asp:textbox CssClass="frm_field" ID="txt_Password"
>> runat="server" TextMode="Password" Width="140" ></asp:textbox>
>> </td>
>>
>> </tr>
>>
>> <tr>
>>
>> <td> </td>
>>
>> <td><asp:button ID="btn_Login" runat="server"
>> Text="Login"></asp:button></td>
>>
>> </tr>
>>
>> </table>
>>
>> <asp:Label ID="lbl_Msg" runat="server" ForeColor="#FF0000" />
>>
>>
>> </form> </td>
>>
>> <td width="13"
>> background="../Site_Graphics/Shdw_Tan_Rt.jpg"> </td>
>>
>> </tr>
>>
>> </table></td>
>>
>> </tr>
>>
>> </div>
>>
>>
>>
>>
>>
>> </body>
>>
>>
>> Thanks bunches
>>
>>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 31, 2006 Aug 31, 2006

Copy link to clipboard

Copied

You have a way with words...
A bad way.

You have some superb knowledge and an extreme lack of understanding in how
to express that knowledge in a charitable way.
No-one is an expert when they start...

I think Rons opinion change of you could easily have been averted, but it's
obvious you don't care, so whats the point of even trying to explain to you
:)
Hmm. none... see ya!

Cheers,
Rob
http://robgt.com/ [Tutorials and Extensions]
Firebox stuff: http://robgt.com/firebox
Skype stuff: http://robgt.com/skype
SatNav stuff: http://robgt.com/satnav



Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 31, 2006 Aug 31, 2006

Copy link to clipboard

Copied

You guys are funny -- I have another question. But first, thanks. Your answer helped and I figured it out, except one thing. Plus, I'm a master graphic artist and don't really want to be a master programmer, but I do enjoy dabbling and balancing out my left and right brain.

New Question;

When I create the custom ticket in a multiple roll senerio, if I do this:

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
Request.Form["tx_Login"],
DateTime.Now,
DateTime.Now.AddMinutes(30),
Remember_Me.Checked,
"agent");

It works perfectly -- but

When I try to get my roll from the dataset like this:

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
Request.Form["tx_Login"],
DateTime.Now,
DateTime.Now.AddMinutes(30),
Remember_Me.Checked,
<%# sp_Login.FieldValue("Member_Role", Container) %>);

I get this error: Preprocessor directives must appear as the first non-whitespace character on a line

I notice in the code that the opening <% turns blue insead of black and the closing ) is black instead of blue

Thanks again for the help

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 31, 2006 Aug 31, 2006

Copy link to clipboard

Copied

You don't need the directives in your script block.

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
Request.Form["tx_Login"],
DateTime.Now,
DateTime.Now.AddMinutes(30),
Remember_Me.Checked,
sp_Login.FieldValue("Member_Role", null) );

Ron

"cyber_worker" <webforumsuser@macromedia.com> wrote in message
news:ed7dl1$kso$1@forums.macromedia.com...
> You guys are funny -- I have another question. But first, thanks. Your
> answer
> helped and I figured it out, except one thing. Plus, I'm a master graphic
> artist and don't really want to be a master programmer, but I do enjoy
> dabbling
> and balancing out my left and right brain.
>
> New Question;
>
> When I create the custom ticket in a multiple roll senerio, if I do this:
>
> FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
> Request.Form["tx_Login"],
> DateTime.Now,
> DateTime.Now.AddMinutes(30),
> Remember_Me.Checked,
> "agent");
>
> It works perfectly -- but
>
> When I try to get my roll from the dataset like this:
>
> FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
> Request.Form["tx_Login"],
> DateTime.Now,
> DateTime.Now.AddMinutes(30),
> Remember_Me.Checked,
> <%# sp_Login.FieldValue("Member_Role", Container) %>);
>
> I get this error: Preprocessor directives must appear as the first
> non-whitespace character on a line
>
> I notice in the code that the opening <% turns blue insead of black and
> the
> closing ) is black instead of blue
>
> Thanks again for the help
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 31, 2006 Aug 31, 2006

Copy link to clipboard

Copied

LATEST
Thanks - you all are awesome. The tutorial, which is listed right on the dot.net home page ( http://www.adobe.com/devnet/dreamweaver/dotnet.html) is overall very helpful, but could use a small edit here or there.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines