|
WHile using the "viewstate" option with web developing, all the Server Controls are added into the "viewstate" hidden input box. Let's say I have a comboobx on my page and after loding it to the client, he is trying to choose another option of the combobox, and I haven't written any event related to this control.
Is it realy true that the page is been reloaded and go back to the server, and make the screen flick just to make this simple client side mission (for showing the other option which already there)?!.
whith Html/JavaScript it takes no time and not reflecting on the screen?!
THanks in advance,
RUVI
|
|
|
|
|
hi,
cant understand your question fully. but if you want to know when the page is posted to the server then i can say-------
clicking of a asp.net button only cause a post back.changing selection of a combo will not cause a post back until the AutoPostBack property
of a control(a combo,a chechkbox,a radiobutton etc etc.) is set to True .
Is this the answer you were searching for????
keep in touch
tirtha
Live life to the fullest
|
|
|
|
|
i am designing a website for someone. i would like to know how i can create a domain "whois" using ASP.NET. i would also like to know how the website can be created using asp.net
|
|
|
|
|
i am designing a website for someone. i would like to know how i can create a domain "whois" using ASP.NET. i would also like to know how the website can be created using asp.net
|
|
|
|
|
I want to display recrod from access that detail information about user to TextBox, please help me
Thanks
................
|
|
|
|
|
can you please explain lit bit more wot you want exactly....
if u explain properly then more chances that you will get your answer...
Thanks
Nav.
|
|
|
|
|
I mention that, in my web site i have many users, If they signin I want to show them about their datail that they can edit it in TextBox
................
|
|
|
|
|
its prety basic stuff can you pls pin point where you getting problem for this
here is code sample which tell you how to connect to db file and get data
OleDbConnection con;<br />
OleDbDataAdapter da ;<br />
DataSet ds = new DataSet();<br />
string sSQL;<br />
sSQL = "select * from Products";<br />
<br />
<br />
string sConStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\Northwind.mdb; User Id=admin; Password=";<br />
<br />
con = new OleDbConnection(sConStr);<br />
da = new OleDbDataAdapter(sSQL,con);<br />
<br />
da.Fill(ds, "Products");<br />
<br />
return ds;
Nav.
|
|
|
|
|
Yes i get it, but I want to retrive to it to TextBox that user can change their information.
Socheat
................
|
|
|
|
|
hi,
keep the user id in the session variable.go to another page(where you want to show the detail information).extract the user id from session.run a query against the user id and display the details on that page.
hope you got it.
tirthadip
Live life to the fullest
|
|
|
|
|
Can you give me full example?
Socheat
................
|
|
|
|
|
I'm using the vb script to write the page. May I know how to include the ASP file into my .aspx page? Did anyone try this before? Can you giv me a guide or sample code to continue my development process? I will appreciate upon your help. Thanks..
|
|
|
|
|
For ASP
For ASP.NET may not
Hope can help you
................
|
|
|
|
|
Socheat.Net wrote: For ASP
For ASP.NET may not
Thanks.. but is there any way to include the .asp page in ASP.net?
Best Regards,
Pei Sun
|
|
|
|
|
I have tried but get nothing, I hope i can get in future.
Socheat
................
|
|
|
|
|
You can't mix ASP and ASP.NET in the same page.
If you register the file type to be handled by both engines, you might be able to make one engine output code that will be executed by the next. I don't know if this is even possible, and if it is, it's hardly advisable.
If you want to show the content of an ASP page as part of an ASPX page, you can place an iframe on the ASPX page and show the ASP page in it.
Also, you could make the ASPX page request the ASP page from the server, and incorporate the response as part of the page.
---
b { font-weight: normal; }
|
|
|
|
|
HI
i hv textbox ,and in this textbox the student enter the rollno,after entering the rollno the student press the enter key,,whn the student press the enter key i wnt to capture the Enter Event on the textbox and getvalues from the textbox,how can i capture the enter event ..,and after getting the value from the text box i fill the droopdwnlist on the behave of rollno.
tell me how can i get the enterkey Press ,and on this Enter key i wnt to take the value from the textbox
|
|
|
|
|
you can use script to call the onkeypress function and from there call any event in your code to fill your list like this
in page load event write this line
TextBox.Attributes.Add("onkeydown", "FillList()");
write this script in aspx page
function FillList()<br />
{<br />
if(event.keyCode == 13)<br />
{<br />
document.getElementById("Buttion2").click();<br />
}<br />
}
you must have a Button2 click event in your code file to fill list.
Hope this will help
hope this will help you
Nav.
|
|
|
|
|
i have no button in my from,i have a dropdownlist that i wnt to fill whn a uere press the enter key in the textbox,i want to load the dropdownlist when user press the Enter key in the textbox..would i write the
document.getElementById("Dropdownlist").click();
or tell me abt click event ,how can i write this event in the ,i mean to say can i write this event in code,how?
i shall be thkfull
-- modified at 6:02 Wednesday 5th July, 2006
|
|
|
|
|
you can add a button to your page and make it invisible and handle list fill on button click event.
Nav.
|
|
|
|
|
this i call in the page load event
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'Fill Drop Down List with Years
'conConnection.Open()
If Not Page.IsPostBack Then
txtrollno.Attributes.Add("onkeydown", "fill_list();")
bt_hidden.Visible = False
End If
End Sub
this is my javascript
function fill_list()
{
if(event.keycode==13)
{
document.getElementById("bt_hidden").click;
}
}
this is my hidden button that id is btn_hidden
"""<asp:button id="bt_hidden" runat="server" ""onclick="loads" visible="False" ""height="19px" width="56px" text="Button">"""
this is my load fuction that i call onClick bt_hidden event
Sub loads(ByVal sender As System.Object, ByVal e As System.EventArgs)
Session.Add("Rollno", Trim(txtrollno.Text))
Try
Dim ds As DataSet
Dim ad As New OleDbDataAdapter
Dim conn_string As String = ConfigurationSettings.AppSettings.Item("DBSettings")
conConnection = New OleDbConnection(conn_string)
conConnection.Open()
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
cmd.Connection = conConnection
cmd.CommandText = "SELECT DISTINCT Setup_Session.Description " & _
"FROM Course_Result LEFT OUTER JOIN " & _
"Setup_Session ON Course_Result.Session_id = Setup_Session.Session_ID " & _
"WHERE (Course_Result.Rollno = 'b-00250')"
'"WHERE (Course_Result.Rollno = '" & Session.Item("Rollno") & "')"
'ds = New DataSet
cmd.CommandType = CommandType.Text
dr = cmd.ExecuteReader
While dr.Read
ddlSession.Items.Add(dr.Item("Description"))
End While
conConnection.Close()
Catch ex As Exception
lblMsg.Text = "Db Server is Down"
lblMsg.Visible = True
End Try
End Sub
bt my dropdownlist is nt filled
tell me either i can fill the dropdoenlist in this clickevent
'Private Sub bt_hidden_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_hidden.Click
tell me where i got wrong ..plz
|
|
|
|
|
can you pls try by setting visible property to true and button width to zero
and write a test function which add on or two items in list like this
FillList()<br />
{<br />
ddlSession.Items.Add("A");<br />
ddlSession.Items.Add("B");<br />
}
and call this function from button click to check that flow is working.
if its working then you need to check your load function.
Nav.
|
|
|
|
|
the problem is exist in the javascript,javascript function not call the click event of the button server control.......tell how can i call the click event of the server control
thks
|
|
|
|
|
dont set the button visible to false and then try
Nav.
|
|
|
|
|
Hi, I have written following piece of code on button click event to fill the data in DataGrid in C# Windows application and in ASP.NET web application. I am using SQL 2000.
<br />
string sConnection=@"Data Source=(local)\SOFTSKILLS; Initial Catalog=Northwind; Integrated Security=True";<br />
SqlConnection con = new SqlConnection(sConnection);<br />
con.Open();<br />
string sSQL = "Select * from Employees";<br />
SqlDataAdapter adpt = new SqlDataAdapter(sSQL, con);<br />
DataSet ds = new DataSet();<br />
adpt.Fill(ds);<br />
dataGrid1.DataSource = ds;<br />
con.Close();<br />
The windows application code works but I get errors in ASP.Net webform application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'machinename\ASPNET'.
Source Error:
Line 59: string sConnection=@"Data Source=(local)\SOFTSKILLS; Initial Catalog=Northwind; Integrated Security=True";
Line 60: SqlConnection con = new SqlConnection(sConnection);
Line 61: con.Open();
Line 62: string sSQL = "Select * from Employees";
Line 63: SqlDataAdapter adpt = new SqlDataAdapter(sSQL, con);
Source File: c:\personal folders\manisha\vs 2003 projects\myprojects\anil\webform1.aspx.cs Line: 61
Stack Trace:
[SqlException: Login failed for user 'ANIL-MANISHA\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
Anil.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\personal folders\manisha\vs 2003 projects\myprojects\anil\webform1.aspx.cs:61
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Can anyone please suggest me whats going on here?
Thanks.
|
|
|
|