|
Specify us which version that you use for login page
Regards,
LEE
|
|
|
|
|
Thank You Lee for ur reply......
Iam using Asp.net 1.1.4322 version using visual studio net 2003
please let me know
regards
|
|
|
|
|
Hi Pls change connection string as per u r database then it will work
if u have any Quries then write a mail to pusnsuresh@yahoo.com...
imports system.data.sqlclient
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
con=new sqlconnection("Data source=B4-2F-128-HTB2\SQLSVR; user id=sa; password=; Database=New_Cart")
con.Open()
Try
cmd = New SqlCommand("select Pwd from Login where UserName=" & "'" & Textbox1.Text & "'", con)
dr = cmd.ExecuteReader()
If dr.Read Then
If Textbox2.Text.Trim.Equals(dr(0)) Then
Response.Redirect("Home.aspx")
Else
Label1.Visible = True
Label1.Text = "Invalid Pasword"
End If
Else
Label1.Visible = True
Label1.Text = "Invalid UserName"
End If
Catch ex As Exception
Response.Write(ex.ToString())
End Try
|
|
|
|
|
How can i get values in between some tags. I have one pre tag and i want to get the value contained in the pre tag.
Eg :
<pre>I want this code<br>next line</pre>
any idea? can i use regular expressions ? how can i form a regular expression for this..
Cheers
Navaneeth!!
www.w3hearts.com
|
|
|
|
|
If your trying to do it server side you could set runat="server" on the tag and give it an ID. It will create an HtmlGenericControl that has the properties InnerHTML and InnerText
|
|
|
|
|
I dont understant it run with Database
Example Membership.GetAllUsers()
How do it run to get data On database ??????
|
|
|
|
|
The code below in the HTML is throwing me the above error :
<HTML>
<HEAD>
<title>WebForm3</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script>
function fire()
{
document.Form1.action = "WebForm4.aspx";
document.Form1.submit();
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<input type="hidden" id="hid1" name="hid1" runat="server" value="test">
<asp:Button ID="but1" Runat="server" Text="test1"></asp:Button>
</form>
<br>
<br>
<br>
</body>
</HTML>
I am firing the javascript using
but1.Attributes.Add("OnClick", "fire();")
I want the hidden variable on WebForm4.aspx.
How can I get the same
|
|
|
|
|
Hi
Use Server.Transfer to redirect to a new page. Remove Javascript function
Request.Form["id"] to get value from previous form that is posted to new page.
Rate this message. Thank you. Harini
|
|
|
|
|
I want to do as it is without any changes as this is the requirement.
I do not want to do nay thing in the code behind file.
|
|
|
|
|
Hi
I found one solution for that.
Set
EnableViewStateMac="false" at the Page attribute in the WebForm4.aspx file.
Rate this message. Thank you. Harini
|
|
|
|
|
Thanks harini ur idea worked, Now i want to do something in a work around way.
I have an aspx page , on which i have removed the complete parts. on this page I am printing a value from the Session , which contains a form by itself.
Now I want to change the action of this form and also submit this form so that I can get the hidden variables of this form on another normal aspx page.
could u suggest how to go about with this problem
|
|
|
|
|
Hi in my web page,
some of the users have limited rights & some others are admin,
the limited users can access some of the pages only,
i have menu bars in my asp.net page,
my doubt is,when he logged on......,based on the user rights what are the menus he can access that only want to display for him,
how to do that,
plz if u have code plz send me.....,
Regards,
Magesh
|
|
|
|
|
hi
For this, you can assign some priorities for the users based on their authentication level.
Say, for Admin the priority can be '1',Manager be '2' etc.. and save it in the table where you save the login details.
While clicking enter key of the Login page,u can check the user's Username,Password and this priority and based on that, you make the menu items disabled or their click events not to fire...
This way you can do...
~VSree
|
|
|
|
|
|
Hi sree,
I tried but i didnt get solution......
If u have any sample code for this send me....,
regards,
Magesh
|
|
|
|
|
Hi all
On Vs2005 have ObjectDataSource when i chose Datasource of GridView is ObjectDataSource i can use fuction Edit on GirdView(When click link edit on row after that this row convert to text box i can write some think) but when i dont use ObjectDataSource so i use code behide agisn:
GridView.DataSource = dt;
GridView.DataBind();
so i click Edit is not convert to Text box
(Edit is buttonfield have Commandname is "Edit" same event "GridView_RowEditing")
How can i use GridView.DataSource = dt; GridView.DataBind(); so still click button edit this row convert to textbox
Some body help me????
|
|
|
|
|
Hello there, i just need your opinion about this...i have now database and all i need to do is to connect it on this page..my question is..where i should put the code of connecting this page to my database that has a column of "ID" and "Password" and it has already a data of "ID:054806054" and PAssword:"blitz2bleach"...can i access it on my database..should i used a "connection string" on it?what is the easy to used "data Source"?sqlDataSource or AccessDataSource?...i dont want to include some ado.net on it...it is possible to code it only in asp.net?..
this are the codes hope you can help me and should i get your opinion what code i should remove and add..and in where i should put it...
sorry but i know that all you can do is to make a comment but this is urgent..it is our project to bulid a website and im new in progamming in asp.net, i read books and have aself study on it..but the things is actual teaching is the best, but here no one in my professor can teach me..
hope you can help to figure out what should i add and remove code..
for now thank you for you cooperation and for the help you will given me n advance... ;)
----.this code is from the file name "index.aspx"
<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" errormessage="*"
="" display="Dynamic" controltovalidate="txtUname">Username |
|
<asp:requiredfieldvalidator display="Dynamic" id="RequiredFieldValidator2" controltovalidate="txtPass" runat="server" errormessage="*">Password |
| |
<asp:button id="Button1" runat="server" text="Sign In" postbackurl="index.aspx">
|
<-------End of code "index.aspx"
-------------->this code is my index.aspx.vb
Option Explicit On
Imports System.Data.OleDb
Imports System.Configuration.ConfigurationSettings
Imports System.Web.Security
Namespace Informatics
Partial Class index
Inherits System.Web.UI.Page
Dim strString As String
Dim oOleDbConnection As OleDbConnection
Dim sConnString As String
Dim oOleDbCommand As OleDbCommand
Dim oOleDbdr As OleDbDataReader
Dim tempUser As String
Dim tempPass As String
Dim ctr As Integer
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.odaGbook = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
Me.PdsGbook2 = New Informatics.pdsGbook
Me.OleDbCommand1 = New System.Data.OleDb.OleDbCommand
CType(Me.PdsGbook2, System.ComponentModel.ISupportInitialize).BeginInit()
'
'odaGbook
'
Me.odaGbook.DeleteCommand = Me.OleDbDeleteCommand1
Me.odaGbook.InsertCommand = Me.OleDbInsertCommand1
Me.odaGbook.SelectCommand = Me.OleDbSelectCommand1
Me.odaGbook.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "gbook", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("address", "address"), New System.Data.Common.DataColumnMapping("age", "age"), New System.Data.Common.DataColumnMapping("gender", "gender"), New System.Data.Common.DataColumnMapping("ID", "ID")})})
Me.odaGbook.UpdateCommand = Me.OleDbUpdateCommand1
'
'OleDbDeleteCommand1
'
Me.OleDbDeleteCommand1.CommandText = "DELETE FROM gbook WHERE (ID = ?) AND (address = ? OR ? IS NULL AND address IS NUL" & _
"L) AND (age = ? OR ? IS NULL AND age IS NULL) AND (gender = ? OR ? IS NULL AND g" & _
"ender IS NULL)"
Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""C:\Documents and Settings\Joy.PHOENIX-1D0486C\Desktop" & _
"\db1.mdb"";Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:S" & _
"ystem database=;Jet OLEDB:SFP=False;persist security info=False;Extended Propert" & _
"ies=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create Syst" & _
"em Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact" & _
" Without Replica Repair=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1" & _
""
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO gbook(address, age, gender) VALUES (?, ?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("address", System.Data.OleDb.OleDbType.VarWChar, 50, "address"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("age", System.Data.OleDb.OleDbType.Integer, 0, "age"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("gender", System.Data.OleDb.OleDbType.VarWChar, 50, "gender"))
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT address, age, gender, ID FROM gbook"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE gbook SET address = ?, age = ?, gender = ? WHERE (ID = ?) AND (address = ?" & _
" OR ? IS NULL AND address IS NULL) AND (age = ? OR ? IS NULL AND age IS NULL) AN" & _
"D (gender = ? OR ? IS NULL AND gender IS NULL)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("address", System.Data.OleDb.OleDbType.VarWChar, 50, "address"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("age", System.Data.OleDb.OleDbType.Integer, 0, "age"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("gender", System.Data.OleDb.OleDbType.VarWChar, 50, "gender"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_address1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "address", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_age1", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "age", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_gender1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "gender", System.Data.DataRowVersion.Original, Nothing))
'
'PdsGbook2
'
Me.PdsGbook2.DataSetName = "pdsGbook"
Me.PdsGbook2.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.PdsGbook2, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Protected WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Protected WithEvents PdsGbook1 As Informatics.pdsGbook
Protected WithEvents PdsGbook2 As Informatics.pdsGbook
Protected WithEvents OleDbCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents odaGbook As System.Data.OleDb.OleDbDataAdapter
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
Public Overrides Sub Dispose()
End Sub
End Class
End Namespace
<--------------end of index.aspx.vb
----------------->this code is my web.config file
<configuration>
<appsettings>
<connectionstrings>
<system.web>
<compilation debug="true" strict="false" explicit="true">
<pages>
<namespaces>
<clear>
<add namespace="System">
<add namespace="System.Collections">
<add namespace="System.Collections.Specialized">
<add namespace="System.Configuration">
<add namespace="System.Text">
<add namespace="System.Text.RegularExpressions">
<add namespace="System.Web">
<add namespace="System.Web.Caching">
<add namespace="System.Web.SessionState">
<add namespace="System.Web.Security">
<add namespace="System.Web.Profile">
<add namespace="System.Web.UI">
<add namespace="System.Web.UI.WebControls">
<add namespace="System.Web.UI.WebControls.WebParts">
<add namespace="System.Web.UI.HtmlControls">
<authentication mode="Windows">
<------------end of web.config file
|
|
|
|
|
Use the "Ignore HTML" option when you post markup code.
It would also help if you only post the relevant code, and not hundreds of lines of auto-genereted code.
---
single minded; short sighted; long gone;
|
|
|
|
|
I hope you didn't just give us your actual password. Anyway, you store your connection strings in Web.config, or Machine.config. I prefer to use machine.config because it's more secure, and I can have a different connection string on my development machine, and my junior guys don't f*** it up when they upload web pages.
The documentation for web.config and machine.config is very complete and it's on the web and in your MSDN files. Should be easy to find.
|
|
|
|
|
well thank you..and the password i put is just a sample..im not that stupid..thanks again...
|
|
|
|
|
I have an .aspx page with an .ascx webcontrol on it.
Is there a way for the webcontrol to programatically get the name of an .aspx page ?
|
|
|
|
|
One idea is to look at Page.Title. Usually the Title of the page is the same as the name. This gets set in the @Page directive in the aspx.
Hope that helps.
Ben
|
|
|
|
|
If you had a page called myPage.aspx and a UserControl called myControl.ascx
within the myControl.ascx.cs file you can say:
string parent_page = Parent.Title;
Or, you can do things like:
if (Parent is myPage) {
Visible = true;
} else {
Visible = false;
}
This would effectively make the control invisible on any other page than myPage.aspx, or any other pages that inherit from that page. In your myPage.aspx.cs file, you can just use the Title property directly. This is a good way to safely make UserControl objects that twiddle properties in their parent page because you can avoid the runtime error which would be caused if you tried to access properties that don't exist.
|
|
|
|
|
Hi I am trying to practice .NET and thought of doing a project on my own of Shopping cart. I want to design a webpage where users can login and buy. It should also give them a sort of report with dates when they bought the items and details of those items.
So can someone guide me with how to start the project. Please give me guidance so that I can write the code on my own and get some practice in writing code.
As per now I have designed a homepage with option of items, user login screen to login. This is just a dynamic page.
Is this right place to start. Please guide me.
|
|
|
|
|
Yeah it's a great project for a beginner. It has a good starting point with quick return on your effort, and many possible optimisations and features to play with. A good place to start though (and you had to know I would say this), is Google. As a beginner, it's best you learn this right up front. When you start a new project, Google everything you can about it. Get an idea of what the technical issues are, and what the scale of the project will be. Find out if someone has already done your project and if you can get the code from them, or buy a product to solve your issue. Put the words "sample code" and "open source" into your Google queries, and include any languages or technologies in your query as well. This will help the Google engine zero in on programming articles. After you've Googled the heck out of the issue, then if you still want to do the project, you can start writing code. Of course, you start that by not actually writing any code, but that's another issue altogether. Try this:
http://www.google.com/search?q=ASP.Net+shopping+cart+sample+code[^]
OR this:
http://www.google.com/search?q=C%23+.Net+shopping+cart[^]
(1st result is codeproject.com, also a good resource)
Google is the best programming resource ever invented. What I wonder is... to whom were 40 billion questions a day adressed before Google? Librarians?
|
|
|
|
|