|
Personally I think that it will be a bad idea to use javascript for validations such as user and password. If you really want to use flashy stuff for validation, use Ajax.
|
|
|
|
|
for starters you can learn Ajax from www.w3schools.com. But for Ajax you need to have knowledge of Javascript, XML.
|
|
|
|
|
This is a disaster. You should never assume that ANYTHING on the client side is what you expect, anything you do in client side, should be validated on the server. It's trivial to hack your page, and make it accept any password you like. It's also trivial to view the source, and see all the username/passwords in your system. Even allowing SQL that returns all the user details is a mess and should be avoided. Please tell me you're just playing around, and no-one will ever rely on this code for security ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christian Graus for advice.
I was just playing around.
I will be highly thankful to you if you can tell me what the Mistake is there in following line
var arrayNames=<%=ArrayNames%> ; // ERROR COMES IN THIS LINE ,,,
Thanks again.
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
How to deploy our application in three Machines in splitted environment like below ?
1 Machine - ASPX pages with Code behind as a dll (Presentation Tier)
2 Machine - COM+ dll (Business Tier)
3 MAchine - SQL Server (DataBase Tier)
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hello Developers
Anyone here implemented Google Base API??? Or anyOne knows about some ASP>.net control to implement this in a better way?? Thanks for ur time
|
|
|
|
|
hi friens
i wrote the code in codebehind to check avilability username from database(it is work fine).
but page has CAPTCHAImage concept.if i click that check avilability button
the page refreshed the CAPTCHAImage refreshed.
how can i reduce the refershment of CAPTCHAImage
i try AJAX also.i use AJAX my entire functionality should change
i used ispastpack also not suitable
can anyone help me
regards
saravanan
|
|
|
|
|
|
In the aspx page, in page directive section use the smartNavigation =true, this will handle the refreshment of page, it will support IE5.5 or above
Regards
MAHESH
|
|
|
|
|
Hi.
I need to cache a usercontrol on a page.
I have tried:
<%@ OutputCache Duration = "100" VaryByParam="none" %> in the design of the UC.
And it gives the OBJECT NOT SET TO AN INSTANCE... error on the container page when i try to reference the UC.
I have also tried:
Response.Cache.SetExpires(DateTime.Now.AddSeconds(100));<br />
Response.Cache.SetCacheability(HttpCacheability.Public);
in the page load of the usercontrol.
In the container page code i try:
if (UCarticles1.CachePolicy.SupportsCaching)<br />
{<br />
UCarticles1.CachePolicy.Duration = new TimeSpan(0,0,20);<br />
}
But I get the value of false from the if statement.
Can someone help me please? What am I doing wrong?
Thanks for your help.
|
|
|
|
|
Hi,
Caching in UserControls is called Fragment Caching.
When u use Fragment Caching you can not perform any operation with the instance of that usercontrol in the container page's codebehind. and if u try to do so u will get NullReferenceException.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Thanks for that. Can you give some sort of example?
Thanks
|
|
|
|
|
Hi,
Your usercontrol itself is an example.
You just remove caching feature from your user control and then try to run you application.
I m sure u wont get exception at that time.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I NEED caching to run my app., hence I cannot remove the caching feature.
I want the contents of the UC to be cached for 2 minutes and then afterwards, get the updated contents and display on container page and then cached again...
Thanks
|
|
|
|
|
Hi,
If its neccessary to user Caching in ur usercontrol then you should choose some other approach to implement the functionality that u want to implement by using reference of UC in the page codebehind.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Thanks.
I'll see what I can come up with.
|
|
|
|
|
Add the following element to the OutputCache directive for your usercontrol
VaryByControl= name of the property by which u want to cache your control
|
|
|
|
|
Hello to Everyone,
How can we use multiline and New line character in asp.net(vb)
Thank You.
|
|
|
|
|
Well hemant im unsure but I think "vbCrLf" can be used for newline.
|
|
|
|
|
Hi, I finally got my code to send a user's username and password to the database. However, it did not check to see if the username has already been taken and did not prompt the user for a new username like it was designed to. I will put in code to prevent sql injection and use other validations later. As for now I just want it to work. Please help point out the cause of this problem. Thank you in advance for your help
Private Sub lblRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblRegister.Click
Dim myConnection As OdbcConnection
Dim myCommand As OdbcCommand
Dim strInsert As String
Dim strSQL As String
strSQL = String.Empty
myConnection = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDB;User=myUser; Password=myPW;Option=3;")
strSQL = String.Format("SELECT UserName FROM myTable WHERE (UserName='{0}');", txtUserName.Text)
myCommand = New OdbcCommand(strSQL, myConnection)
myCommand.CommandType = CommandType.Text
myConnection.Open()
Dim result As Integer = myCommand.ExecuteNonQuery()
If result > 0 Then
lblMessage.Text = "That user name is already taken!"
lblMessage.Text &= " Please choose another user name."
Else
strInsert = "INSERT into myTable (FirstName,LastName,Password,UserName)values (?,?,?,?)"
Dim myCommand1 As OdbcCommand = New OdbcCommand(strInsert, myConnection)
myCommand1.CommandType = CommandType.Text
myCommand1.Parameters.Add("@FirstName", txtFirst.Text)
myCommand1.Parameters.Add("@LastName", txtLast.Text)
myCommand1.Parameters.Add("@Password", txtPassword.Text)
myCommand1.Parameters.Add("@UserName", txtUserName.Text)
Dim result1 As Integer = myCommand1.ExecuteNonQuery()
myConnection.Close()
End If
txtFirst.Text = ""
txtLast.Text = ""
txtUserName.Text = ""
txtPassword.Text = ""
End Sub
|
|
|
|
|
Hi,
In which context your code doesnt work?
Do u get any error or exception? if yes then at which line?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
The code ran without any error messages and it sends the user's info such as username, password, etc to the database for storage. However, to my surprise when I check to see if it had checked for duplicate username when someone registers, it did not do so. The select statement was supposed to count the number of row in which UserName'{0}' = txtUserName.text. If the row count is greater than 0 then the username is already in use and an error message was supposed to fire. I don't know if that is the problem, it looks fine to me though. Please take a close look at the code, perhaps you'll find something I overlooked. Thank you again for your help.
|
|
|
|
|
Hi,
I think you will have to change your query.
When commandtext of Command object is a SELECT statement you should not use ExecuteNonQuery() method on it coz this method returns the total number of affected row. here in SELECT query it is not affecting any row hence it will return "-1" always it doesnt matter what the SELECT query is returning.
So according to me you should change you 'SELECT' query and also should call ExecuteScalar method on your command object.
Your query should be as following
strSQL = String.Format("SELECT Count(UserName) FROM myTable WHERE (UserName='{0}');", txtUserName.Text)
and you should call the ExecuteScalar function on your command which will return the count of username found.
Dim result As Integer = CType(myCommand.ExecuteScalar, Integer)
Now if the username is not found in the table then result will have value ZERO (0) otherwise it will have the count of username found in the table.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
|
Hi all:
I have a comunications problem, and hope someone can help.
I have a page with a formview, [myForm.fvSpecies] in it, with the Insert method bound to a class method [clsSpecies.Insert], which itself calls an method in another class, [clsDBUpdate.Insert] that holds SQL.
This all works find, and on completion, [clsUpdate.Insert] (automatically behind-the-scene) raises an [ItemInserted] event that is trapped and handled by my [myForm.fvSpecies], as expected.
However, the problem occurs when I programmatically decide not to do the insert, eg if the user is not authorised.
AFAICS, the ItemInserted event arguments are identical, whether the actual insert happened or not (which is fair enough as the method [clsSpecies.Insert] completes, whether it calls [clsDBUpdate.Insert] and executes the SQL or not).
But what i want to do is to inform fvSpecies whether the update really occured or not.
I have tried to update the event-arguments of ItemInserted, but I cannot work out how, and I have tried to raise an event myself, but i cannot trap it: so please can anyone explain how my [clsSpecies.Insert] method can communicate with fvSpecies formview, via the ItemUpdated method or some other way, so I can be in control of the parameters and set a message or a code or something, myself, so the [myForm.fvSpecies] (or containing form myForm) knows what happened?
There must be a simple way to be in control of this communication, either by piggy-backing the automatic ItemInserted event or raising another event myself: but I cannot figure it out or find it.
Many thanks -
aitch
--x---
|
|
|
|