[RESOLVED] My Login form not work after publish in IIS
hi all, i have a problem annoy me.
I create some asp.net program in Visual Studio 2008.
i am using File --> New Website to create website.
it work fine when debug F5 in visual Studio.
But after i publish and put the result in folder C:\Inetpub\wwwroot.
that code not work without return any error message so i cannot trace the problem.
if The database in same machine with IIS, it work ok. but if database in another computer, i cannot run my Login not work.
i believe the problem is my method deployment still not correct.
my method:
i publish website with right clik in solution ,and choose publish website.
i choose the direction. after that ,i copy the folder to C:\Inetpub\wwwroot.
I create the Virtual directory,set application name and asp.net version :2.0.50727
When i running http://localhost/DW/Login.aspx. it 's running. But when i clik the button submit for submit my username and password it not return anything.
Can some one give a clue or something link can help me??:sick:
Re: My Login form not work after publish in IIS
Hello,
You haven't specified, but I am assuming that you are using SQL Server, is that correct?
You mentioned that at some points, the database is on another server, have you updated the connection string in the web.config file to reflect the actual location of the database?
Gary
Re: My Login form not work after publish in IIS
What is the error you are getting? You will need to get on the actual server that you published to (if possible) to see the error.
Re: My Login form not work after publish in IIS
Hi all, sry i late reply.
Yes,I am using SQL server 2000.
Yes of course i update my connection string.
here is my connection string:
<add name="SQL2000MbakNina" connectionString="Data Source=PCHO0xxx;Initial Catalog=DW001;User ID=fl;password=ipass;"/>
<add name="SQL2000Gw" connectionString="Data Source=PCHO02xxx;Initial Catalog=DW001;User ID=sa;password=ipass;"/>
My computer is PCHO02xxx. the problem,if i cannot connect another database in different machine from my computer after i publish to IIS.
my code work correct prefectly in visual studio ,even i connect to PCHO0xxx.
but after i publish and copy to IIS. it cannot connect database in PCHO0xxx. but it work perfect if connect to local database.
Re: My Login form not work after publish in IIS
my program always return error message with Java Script .
this my sub for return message:
Quote:
Public Sub Pesan(ByVal pg As Page, ByVal keterangan As String)
Dim popupScriptValidated As String
popupScriptValidated = "<script language='javascript'> alert('" + keterangan + "') </script>"
pg.ClientScript.RegisterStartupScript(pg.GetType, "PopupScriptValidated", popupScriptValidated)
End Sub
and i calling like this
Quote:
Pesan(me.page,"message error")
In validation text box,java script will return mesage box perfectly.
but my code in submit button :
Quote:
If ValidasiInput() Then
Exit Sub
End If
Try
Dim lsEncopass, strnama As String
lsEncopass = MUtility.getMd5Hash(Trim(txtPass.Text).ToUpper)
strnama = txtUserName.Text.Trim.ToUpper
Dim lcmd As New SqlCommand
Dim lDataReader As SqlDataReader
lcmd.CommandText = "CekLogin"
lcmd.CommandType = Data.CommandType.StoredProcedure
lcmd.Connection = koneksiSql.sqlcon
lcmd.Parameters.AddWithValue("kduser", strnama)
lcmd.Parameters.AddWithValue("password", lsEncopass)
koneksiSql.sqlcon.Open()
lDataReader = lcmd.ExecuteReader()
lDataReader.Read()
If lDataReader.HasRows Then
Session("username") = CStr(lDataReader("UserID")).ToUpper
Session("passw") = lDataReader("UserPassword")
Session("KdKonsumen") = CStr(lDataReader("KdKonsumen"))
Session("TipeLogin") = CStr(lDataReader("TipeLogin"))
koneksiSql.sqlcon.Close()
koneksiSql.sqlcon.Dispose()
lcmd.Dispose()
lDataReader.Close()
If Session("TipeLogin").ToString = "E" Then
Response.Redirect("Home.aspx", False)
Else
Dim s As String = Server.UrlEncode(Session("username"))
Response.Redirect("../DataWarehouse/Default.aspx?usr=" & s, False)
End If
Else
labelError.Text = "gagal login"
End If
koneksiSql.sqlcon.Close()
koneksiSql.sqlcon.Dispose()
lcmd.Dispose()
lDataReader.Close()
Catch ex As Exception
MUtility.Pesan(Me.Page, ex.Message)
koneksiSql.sqlcon.Close()
koneksiSql.sqlcon.Dispose()
Exit Sub
End Try
i protect with try catch .
if something problem in access database then program will return message to catch .
and will return java script message box to me.
but in my case, i don't see any message box from java script.
so i decide to right clik my form.
and i found this in my code:
Quote:
<script language='javascript'> alert('Login failed for user 'fl'. Reason: Not associated with a trusted SQL Server connection.') </script>
<script type="text/javascript">
i think i already find something new in my case.
Re: My Login form not work after publish in IIS
Quote:
Originally Posted by
wilang
hi all, i have a problem annoy me.
I create some asp.net program in Visual Studio 2008.
i am using File --> New Website to create website.
it work fine when debug F5 in visual Studio.
But after i publish and put the result in folder C:\Inetpub\wwwroot.
that code not work without return any error message so i cannot trace the problem.
if The database in same machine with IIS, it work ok. but if database in another computer, i cannot run my Login not work.
i believe the problem is my method deployment still not correct.
my method:
i publish website with right clik in solution ,and choose publish website.
i choose the direction. after that ,i copy the folder to C:\Inetpub\wwwroot.
I create the Virtual directory,set application name and asp.net version :2.0.50727
When i running
http://localhost/DW/Login.aspx. it 's running. But when i clik the button submit for submit my username and password it not return anything.
Can some one give a clue or something link can help me??:sick:
You can still debug the Application
1.Open the Respective Project
2.From the Tools menu -->Select Attach to process
3.Select aspnet_wp from the list and click ok
4. But a Break point in the Submit Button Click event
5. Run the Application in IE, And click the Submit Button
6. Now you will get the debug cursor in the Button Click event of project
Re: My Login form not work after publish in IIS
So to clarify, am I right in saying that you are not using the built in Membership controls, such as Login etc, but rather you are using your own controls and logic, correct?
can you show where this:
Is setup?
Gary
Re: My Login form not work after publish in IIS
Quote:
Originally Posted by
gep13
So to clarify, am I right in saying that you are not using the built in Membership controls, such as Login etc, but rather you are using your own controls and logic, correct?
can you show where this:
Is setup?
Gary
hi gep13 , sry to late reply your message.
it just declaration class from Koneksi.
i am declare class Koneksi
to all my form who access database.
this code from Class Koneksi:
Quote:
Public Class Koneksi
Public sqlcon As New SqlConnection(ConfigurationManager.ConnectionStrings("SQL2000MbakNina").ConnectionString)
End Class
but actualy i already find solution from my problem.
the answer because i don't setting my IIS for connect another database in another machine. :bigyello:
i found this link help me:
:D
after i setting my web config with add
<identity impersonate="true"/> in system.web
and i configure directory security in my folder project (in IIS).
i setting password and user name with my computer administrator login .
and it work perfectly. :bigyello::bigyello:
i share for u all . so if u find this problem, you know the answer.
Sry if my english is bad :bigyello:
Re: [RESOLVED] My Login form not work after publish in IIS
Glad to hear that you got this resolved.
Gary
Re: [RESOLVED] My Login form not work after publish in IIS
Thx for your attention. :bigyello: :p