Forum Moderators: open

Message Too Old, No Replies

asp.net, dreamweaver user exists

         

webdeveloper1

9:31 am on Sep 30, 2005 (gmt 0)

10+ Year Member



Hi have a user registration page with an insert record on it. I also have a block of code for checking if the username already exists in the access database. This code works fine without the insert record server behaviour but as soon as I have the insert record code, it ignores my sub to check for the username. Does anyone know how I can get it to run the username checking code before it inserts? Many thanks.

Red_Eye

12:48 pm on Sep 30, 2005 (gmt 0)

10+ Year Member



if(usernameexists(username))
{
insert record
}
else
{
ask to change user name
}

where usernameexists is a method that returns true if username exists

webdeveloper1

4:27 pm on Sep 30, 2005 (gmt 0)

10+ Year Member



Hi, thanks for response, I should have explained that I am using dreamweaver mx to insert info from a form.
I don't know where to put the username exists code in relation to the following:

<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO Users (JPassword, JUsername) VALUES (?,?,)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_first_net") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_first_net") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "login.aspx" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@JPassword" Value='<%# IIf((Request.Form("password") <> Nothing), Request.Form("password"), "") %>' Type="WChar" />
<Parameter Name="@JUsername" Value='<%# IIf((Request.Form("username") <> Nothing), Request.Form("username"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>

Many thanks.

Red_Eye

1:38 pm on Oct 6, 2005 (gmt 0)

10+ Year Member



It looks like there is a function called MM_Insert that fires when you click the button. I would say that it's here that you need to make the changes.

I normally use visual studio and code behind for this so I am not to sure how dreamweaver handles it. If you could post the code for MM_Insert I might be able to help more

john101

5:15 am on Nov 10, 2005 (gmt 0)

10+ Year Member



did you figure this out yet?, i have the same problem using dreamweaver also.