|
Oga make 2nd gridview visible false on page load ovent
You can add your command button in gridvew in desig time by choosing edit columns option.
if you are not using select button for any other purpose i'll suggest use select button and change its text to "what ever you want"
then use gridviwes RowCommand event
following line of code may be helpfull for you.
int rowid=Convert.ToInt32(e.CommmandArgument);
GridViewRow gvRow=this.Gridview1.Rows[rowid];
swith (e.CommandName)
{
case "Select":
Gridview2.visible =true;
break;
}
hope this will give you idea.
|
|
|
|
|
i have a button for going back on page. it is not working .
this.btnBack.Attributes.Add("OnClick","javascript:history.back();");
or with
this.btnBack.Attributes.Add("OnClick","javascript:history.go(-1);");
help me .
thanks in advance
|
|
|
|
|
In what way is it not working?
|
|
|
|
|
it is not going one page back .
|
|
|
|
|
hi,
You can write the code like this
Button1.Attributes("onclick") = "javascript:history.go(-1);"
or
you can use this in HTML
or
you can use link like set href="javascript:history.go(-1);"
Back
-- modified at 8:22 Thursday 5th April, 2007
|
|
|
|
|
I have a site which should recover customer details using a telephone no. entered by calling txtPhoneNumber_TextChanged
TextBox ID="txtPhoneNumber" runat="server" relative" AutoPostBack="True" textChanged="txtPhoneNumber_TextChanged" OnLoad="Page_Load" />
It calls the code behind the first time i use the site.
But the next time I try to use the customer either by drop down of previous details or manual entry id does not call the change method.
What I really need is a field exit event ??
Has anyone any ideas
Thanks
|
|
|
|
|
Hello Everybody, I have XML Serilized data stored in the database. Now I want to Deserialze that data at run time. Anybody know how deserialze data at Run time.
Thanks in Advance
|
|
|
|
|
Hi
I have problem, i currently using asp with ms access and i want to dispaly record one time with 10 records,
please help me
................
|
|
|
|
|
Dear All,
I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2000 as a back End
I am generating report using crystal report 11.
I am populating data to crystalreportviewer. My question is can we arrange or place crystal reportviewer to a particular area .
Thanks
regards
imran khan
|
|
|
|
|
Use html table or asp.net panel or even a custom control.
|
|
|
|
|
Hi
I need to write a regular expressions that will find out a <pre> tag and replaces all HTML tags inside that tag till it finds ending of that <pre>. Any help on writing regular expressions for this will be highly appreciated.
|
|
|
|
|
How can i get tab strip in asp.net 2003. PLease tell me.
Mohinder Singh
|
|
|
|
|
i have one html file .In that html file i am entering login name and password when i click submit button i want to submit data to database using asp.net code.How can i do that......Please help me to solve this problem
|
|
|
|
|
Make your html button a server side control.
Right click the button and select 'run as server side'
Now you can write the logic of saving the data in your database in the button_click event using asp.net code
Gautham
|
|
|
|
|
anujose wrote: i want to submit data to database using asp.net code
Strange ? Why you are suffering this much. Why don't you add aspx page and write the code in codebehind page ?
If you are so specific with this HTML page, then you can set the action url of HTML page form to your aspx page. Then in aspx page using request.form("value") get the value. and do the operations
|
|
|
|
|
i don't want to show the aspx form.i just want to pass 2 values from html file to aspx file and in aspx file i want to validate the username and password
|
|
|
|
|
Hi to all,
I am trying to use FormsAuthentication in my Project but I am getting some Problems.
Code 1:
Private Sub imgbtnSubmit_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbtnSubmit.Click
Try
'call the ValidateLogin function
If ValidateUser(txtLoginId.Value.ToUpper, txtPassword.Value.ToUpper) Then
If Request.Params("ReturnUrl") <> "" Then
FormsAuthentication.RedirectFromLoginPage(txtLoginId.Value, True)
Else
If iStatus = 1 Then
FormsAuthentication.SetAuthCookie(txtLoginId.Value, True)
Server.Transfer("EntrySubscriberDtls.aspx")
Else
FormsAuthentication.SetAuthCookie(txtLoginId.Value, True)
Server.Transfer("ViewSubscriberDtls.aspx")
End If
End If
Else
Response.Redirect("VendorLogin.aspx", True)
End If
Catch ex As Exception
'Throw error Message
txtLoginId.Value = ""
txtPassword.Value = ""
lblErrorMsg.Text = "Invalid Username or Password"
End Try
End Sub
Code 2:
Function ValidateUser(ByVal UserName As String, ByVal Pssword As String) As Boolean
Dim vsVndrPwd As String
Dim dtVendorDet As New DataTable
Try
'For cheking Valid UserName and Password
Session("Username") = userName
vsVndrPwd = Nothing
dtVendorDet = Objallschoolinfo.ValidateLogin(txtLoginId.Value.ToUpper.Trim)
iStatus = Convert.ToInt32(dtVendorDet.Rows(0).Item("bStatus"))
vsVndrPwd = dtVendorDet.Rows(0).Item("vsPassword".ToUpper.Trim)
Catch ex As Exception
lblErrorMsg.Text = ex.Message
End Try
'If Not Found the Record
If (vsVndrPwd Is Nothing) Then
Return False
End If
'if Found the Record
Return (String.Compare(vsVndrPwd.ToUpper.Trim, Pssword.ToUpper.Trim, False) = 0)
End Function
Code:3 Web.config file
<authentication mode="Forms">
<forms name=".NavinsForm" loginurl="./Vendor/VendorLogin.aspx" protection="All" path="/" timeout="30">
<authorization>
<deny users="?">
<allow users="*">
-----------------
Error: When iStatus=1 It's throw the Error:"Thread was being aborted."
When iStatus=0 It's throw the Error:"Error executing child request for ViewSubscriberDtls.aspx."
Mohan Balal
|
|
|
|
|
hi!
your problem is the Server.Transfer method in both cases. you have to do a Response.Redirect(...) with the client so that he gets the auth-cookie. have a look at the differences of both methods in your VS-help.
Make sure that you catch ThreabAbortException which is thrown by Response.Redirect.
in your case:
Private Sub imgbtnSubmit_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbtnSubmit.Click
Try
...
Catch exc as ThreadAbortException
' Do nothing here
Catch ex As Exception
'Throw error Message
txtLoginId.Value = ""
txtPassword.Value = ""
lblErrorMsg.Text = "Invalid Username or Password"
End Try
End Sub
-walter
|
|
|
|
|
Thanks for you reply. Now, I change the Code:
Try
'call the ValidateLogin function
If ValidateUser(txtLoginId.Value.ToUpper, txtPassword.Value.ToUpper) Then
If Request.Params("ReturnUrl") <> "" Then
FormsAuthentication.RedirectFromLoginPage(txtLoginId.Value, True)
Else
If iStatus = 1 Then
Response.Redirect("EntrySubscriberDtls.aspx")
Else
Response.Redirect("ViewSubscriberDtls.aspx")
End If
End If
Else
Response.Redirect("VendorLogin.aspx", True)
lblErrorMsg.Text = "Invalid UserName or Password"
End If
Catch ex As Exception
'Throw error Message
lblErrorMsg.Text = ex.Message
End Try
--------------------------
In Both Case: Error is:"Thread was being aborted."
I am Using Backend code VB.NET and ASP.NET 1.1
Mohan Balal
|
|
|
|
|
As I said before, you have to catch System.Threading.ThreadAbortException. ThreadAbortException is thrown exactly after you do a Response.Redirect. This is normal and it's because the .NET-Framework informs itself that the current thread is beeing aborted. Your problem was that you generally catch every type of exception. Instead you must catch the ThreadAbortException BEFORE you catch any other Exception types. Before you go on, take a look on the documentation of "System.Threading.ThreadAbortException", afterwards it will be clear why you get the message "Thread was being aborted."
so change your code to this:
Try
'call the ValidateLogin function
If ValidateUser(txtLoginId.Value.ToUpper, txtPassword.Value.ToUpper) Then
If Request.Params("ReturnUrl") <> "" Then
FormsAuthentication.RedirectFromLoginPage(txtLoginId.Value, True)
Else
If iStatus = 1 Then
Response.Redirect("EntrySubscriberDtls.aspx")
Else
Response.Redirect("ViewSubscriberDtls.aspx")
End If
End If
Else
Response.Redirect("VendorLogin.aspx", True)
lblErrorMsg.Text = "Invalid UserName or Password"
End If
Catch ex as System.Threading.ThreadAbortException
' Do nothing here, just catch the exception
Catch ex As Exception
'Throw error Message
lblErrorMsg.Text = ex.Message
End Try
hope that helps
- walter
|
|
|
|
|
Web service security is implemented using WSE 2.0 credential passing technique or just block the anonymous access and enabled Integrated Window Authentication. In case of WSE i don't need custom UsernameTokenManager.
Can any one help me to find out the differences between two.
I don't want to allow user acces the web service through URL.
Thanks
Lokesh
|
|
|
|
|
I have tried to copy the contorl from the tab to the form , the following message is displayed
"Control cannot be created because Visual Studio cannot find the control's type in the contorl assembly"
I have tried to replace the DLL , but the control cannot be copied to the form.
Kindly help me out.
Thanx
Ali
|
|
|
|
|
Hi All,
I need to write a query in which date time field is there.I want to display only date either in dd/mm/yyyy or mm/dd/yyyy. I am not getting year in yyyy
I am doing this:
SELECT Convert(nvarchar,ReceivedDate, 6) AS ReceivedDateFromClient FROM Table
Its results in 01 Jan 00.
But I want 01 Jan 2000.
Can any one help me please...
Thanks in advance...
|
|
|
|
|
Learning ASP.NET 2.0 wrote: I am doing this:
SELECT Convert(nvarchar,ReceivedDate, 6) AS ReceivedDateFromClient FROM Table
u have to write this
SELECT Convert(nvarchar,ReceivedDate, 101) AS ReceivedDateFromClient FROM Table
Thanks,
Sun Rays
|
|
|
|
|
Thank you, its working.Thanks
|
|
|
|