|
hai2muru wrote: i need to validate the (username and password) field to check the database the username correct or not ........using javacript validation
Why do you think that you need that?
---
b { font-weight: normal; }
|
|
|
|
|
Javascript runs at client side, made a server table validation is dangerous, its the reason that you dont find many examples
keep Learning and you never will be out of date...
|
|
|
|
|
Hai 2 Muru,
Try the following code:-
Dim user, pass As String
Try
Dim con As SqlConnection = New SqlConnection("server=.;database=tempdb;user id=sa;password=sa")
Dim cmd As SqlCommand = New SqlCommand("select * from verification where uname=@uname and pwd=@pwd ", con)
cmd.Parameters.Add(New SqlParameter("@uname", SqlDbType.VarChar, 20))
cmd.Parameters("@uname").Value = txtUname.Text
cmd.Parameters.Add(New SqlParameter("@pwd", SqlDbType.VarChar, 20))
cmd.Parameters("@pwd").Value = txtPwd.Text
cmd.Connection.Open()
Dim dr As SqlDataReader
dr = cmd.ExecuteReader()
While dr.Read()
user = dr.GetValue(0).ToString()
pass = dr.GetValue(1).ToString()
End While
cmd.Connection.Close()
Catch ex As Exception
lblexception.Text = ex.Message
End Try
If (user = txtUname.Text And pass = txtPwd.Text) Then
Page.RegisterStartupScript("ss1", "alert(""valid"");")
Else
Page.RegisterStartupScript("ss2", "alert(""Invalid"");</script")
End If
Thanks & regards,
Suresh Dayma
<div class="ForumSig"><font face="mistral" size="5" color="teal">Everything Is Possible!</font></div>
|
|
|
|
|
Hai 2 Muru,
Try the following code:
Dim user, pass As String
Try
Dim con As SqlConnection = New SqlConnection("server=.;database=tempdb;user id=sa;password=sa")
Dim cmd As SqlCommand = New SqlCommand("select * from verification where uname=@uname and pwd=@pwd ", con)
cmd.Parameters.Add(New SqlParameter("@uname", SqlDbType.VarChar, 20))
cmd.Parameters("@uname").Value = txtUname.Text
cmd.Parameters.Add(New SqlParameter("@pwd", SqlDbType.VarChar, 20))
cmd.Parameters("@pwd").Value = txtPwd.Text
cmd.Connection.Open()
Dim dr As SqlDataReader
dr = cmd.ExecuteReader()
While dr.Read()
user = dr.GetValue(0).ToString()
pass = dr.GetValue(1).ToString()
End While
cmd.Connection.Close()
Catch ex As Exception
lblexception.Text = ex.Message
End Try
If (user = txtUname.Text And pass = txtPwd.Text) Then
Page.RegisterStartupScript("ss1", "alert(""valid"");")
Else
Page.RegisterStartupScript("ss2", "alert(""Invalid"");</script")
End If
Thanks & regards,
Suresh Dayma
<div class="ForumSig"><font face="mistral" size="5" color="teal">Everything Is Possible!</font></div>
|
|
|
|
|
I am working in ASP.Net2.0 and Sql server 2005.Using asp button(FormView) I am trying to insert the data from the form into the database and at the same time want to move on to another page indicating the succes of insertion.
My code:
<asp:button id="InsertButton" runat="server" causesvalidation="True" commandname="Insert"
="" text="Submit" postbackurl="~/ClinicDownload.aspx">
It is moving on to another page, but no insertion is taking place. If I don't give the PostBackUrl then I can insert. I want to do both in one click....Hope someone can help me.
Regards
preeshma
|
|
|
|
|
Hi Preeshma,
Please try it with the boolean (if the data is inserted into the DB and then it should redirect to the the Success page.)
Hope this will help you.
Happy Coding
With Regards
Satips
|
|
|
|
|
Dear friend
Even if I give the correct data it is not inserting.It just move on to the other page.
Regards
preeshma
|
|
|
|
|
You can do in this way also
submit_click()
{
--------
database code here
if(success)
Server.Transfer("ClinicDownload.aspx");
else
Response.Write("Error occured")
--------
}
|
|
|
|
|
hi all,
how can i automatically setup user email accounts through a .net signup page?
is there some api available for me to look at or is it server specific?
it will be run on a dedicated server eventually.
thank you.
kind regards,
g00fy
|
|
|
|
|
hello, i am using asp.net version 1 and i want to make a window with asp that will be without toolbars, no status bar, no resizing, no menu option. How can i make this? i want to make the height 300 by 300. Help me pls? its like i am opening a page from flash! this page will be this (300 by 300).
Thanks for anyone who help me
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hi,
function open_PopupWindow()
{
window.open('testpage.htm','null',"height=300, width=300,status=no,toolbar=no, menubar=no,location=no");
}
Hope this will help you.
Happy Coding
<div class="ForumSig">With Regards
Satips</div>
|
|
|
|
|
if you are opening from flash you will need to
on(release)
{
getURL("javascript:open_PopupWindow()");
}
regards,
g00fy
|
|
|
|
|
Thanks alot for your help ..
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hello,
I have an Access database with 2 tables: News and News_Localized.
Table "News" has 2 fields "Article_Id" and "Article_Date". "Article_Id" is the primary key. Both fields hold information which doesn't change with culture.
Table "News_Localized" has 4 fields "Article_Id", "Article_Culture", "Article_Title" and "Article_Text".
Basically, I want to load a record which should include the "Article_Date" and the fields "Article_Title and "Article_Text" for a given Article_Culture.
How can I do this?
Should I relate the 2 tables in someway?
What should be the SQL string in my VB.Net code?
Thanks,
Miguel
|
|
|
|
|
Join the tables in the query. Example:
select n.Article_Date, l.Article_Title, l.Article_Text<br />
from News n<br />
inner join News_Localized l on l.ArticleId = n.ArticleId<br />
where n.ArticleId = @ArticleId and l.Article_Culture = @Culture
---
b { font-weight: normal; }
|
|
|
|
|
select
n.Article_Date,nl.Article_Title,nl.Article_Text
from News n, News_Localized nl
where nl.Article_Id = n.Article_Id and
nl.Article_Culture = <selected culture="" here="">"
|
|
|
|
|
Hello All,
I migrated from 1.1 to 2.0 and the DataGrids on WebPages are giving me error in the sense is it firing the Events(ItemCommand,ItemCreated etc) twice.
It was working fine with ASP.NET 1.1....Am I missing some attribute or Property that i will have to Add if I am using DataGrid in 2.0 ( as it is replaced by GridView in 2.0 )?
Has anyone experienced the same before?
Any Suggestions will be most appreciated.
Thanks.
|
|
|
|
|
Still haven't found the solution....Can Anyone suggest something??
Thanks
|
|
|
|
|
How can i send gridview within mail in asp.net
i tried get content of div[runat="server"] which has gridview
but error occurs ("Cannot get inner content of divmail because the contents are not literal.")
how can i achive that,
thanks in advance..
|
|
|
|
|
not sure of current .net support, but i did this a while ago and acheived it by creating an HTML table from iterating the datasource then sending the table as the email.
regards,
g00fy
|
|
|
|
|
I am fairly new to ASP.NET 2.0 and I am able to load a web page up with a report viewer showing 1 .rdlc file. I noticed that there is no print option available on the toolbar but in my reportviewer properties I have "ShowPrintButton" set to true?
Chris
|
|
|
|
|
If you use reportViewer with LocalReport (no MSSQL Reporting services support), then you can't print your reports directly. It is because print functionality uses ActiveX component, which request print information from reporting services server. If you are in local mode, there is no server to ask for this information.
Pilo
|
|
|
|
|
I guess there is no way to pass the local printer information to the reportviewer manually?
Chris
|
|
|
|
|
Hello,
Is it possible to redefine the URL of a page using culture information.
For example, for the URL http://www.domain.com/contacts.aspx:
Culture pt-PT: http://www.domain.com/contactos
Culture en-GB: http://www.domain.com/contacts
I am using Asp.Net 2.0.
Thanks,
Miguel
|
|
|
|
|