Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

LoginView error with CreateUserWizard & OnCreatedUser event

$
0
0

Hey guys, I'm pretty new to C# and ASP.NET, but I'm hoping to get some help on an issue with my fledgling web application that has me stumped so far. I've created a page purposed for user creation (create.aspx). The anonymous template has the user go through registration. Logged in template returns a basic message indicating that the user is already logged in, and would need to log out before registering again. The user creation aspect of it worked fine until I introduced the LoginView templates.

The error: "Compiler Error Message: CS1061: 'ASP.create_aspx' does not contain a definition for 'CreateUserWizard1_CreatedUser1' and no extension method 'CreateUserWizard1_CreatedUser1' accepting a first argument of type 'ASP.create_aspx' could be found (are you missing a using directive or an assembly reference?)"

The markup:

<asp:LoginView ID="LoginView1" runat="server"><AnonymousTemplate><asp:CreateUserWizard ID="CreateUserWizard1" runat="server" AutoGeneratePassword="False" ContinueDestinationPageUrl="~/Interface/Navigate.aspx" OnCreatedUser="CreateUserWizard1_CreatedUser1"><WizardSteps><asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"><ContentTemplate>
..........Some tables...........(redacted)</asp:CreateUserWizard></AnonymousTemplate><LoggedInTemplate><br />
                Log out before you try creating a new character!</LoggedInTemplate></asp:LoginView>

The codebehind:

{
    public partial class Create : System.Web.UI.Page
    {

        

        protected void CreateUserWizard1_CreatedUser1(object sender, EventArgs e)
        {

            // Set & Establish Connection String

            string constring = "Data Source=.\\SquareSQL;Initial Catalog=SquareV1;Integrated Security=True";
            SqlConnection connection = new SqlConnection(constring);

            // Pull TextBox Control

            CreateUserWizard cw = (CreateUserWizard)LoginView1.FindControl("CreateUserWizard1");
            CreateUserWizardStep cws = (CreateUserWizardStep)cw.FindControl("CreateUserWizardStep1");
            TextBox UserNameEntry = (TextBox)cws.ContentTemplateContainer.FindControl("UserName");


<<<Some Database Action, Irrelevant I think>>>

Any thoughts?


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>