|
If you use runat="server" you need to create javascript variables to hold the client side Id, which is represented by the ClientID property, and is not the Id you set on the server side.
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 )
|
|
|
|
|
Hi Christian Graus.
So How can we get CientID of any server control?
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Hi all,
I am working on a project in which I have used Telrik TreeView control But I want to scroll the page when I am draging a node and droping on a node.Reply me If u have any way of it..
Thanks
Sapan Roy
Hi all go for this...
|
|
|
|
|
Hi Sapan,
Better u browse telerik.com and post a thread in the forum.
Its not correct to ask here.
Hope u will succeed
Have a Nice Day Dude
|
|
|
|
|
Hi friends..plz go through this pseudo code
I Included Requirid Namespaces
Dataset ds;--------------------------------------1
//static Dataset ds;-----------------------------2
protected void page_load(parameters)
{
ds = function in Data acesss Layer which retrives records from database and returns dataset.
populatedatagrid();
}
void populatedatagrid()
{
if(mydropdownlist.selectedIndex=0)
datagrid1.datasource=ds;
else
{
datagrid1.Datasource= here I performed filtering action using Row Filter Property and selected Index Value
}
}
void mydropdownlist_selectedIndexchanged(parameters)
{
populatedatagrid();
}
I am designing a web page where by default all records will displayed.but by selecting from dropdownlist I can filter the records.Later I thought its not right to perform the fuctionalities of the page_load event at each postback(unnecessry making connection to the database)..so i used Page.Ispostback to avoid that..so first time it worked fine but when i selected from dropdwn list it throws an error "object reference not set to an instance of object"..
reason for above error i understood(because in page load event i am returning dataset which does not happened at page post back)..so one of my friend commented the line no-1 and uncommented the line no-2 in above code..thus made dataset static..and it works
What I am not understanding is why making the dataset static solved the task..though HTTP is static?Is making dataset ststic makes the records to be saved at server?
Warm Regards,
Rahul Agarwal
-- modified at 7:11 Tuesday 12th June, 2007
|
|
|
|
|
change the property of dropdownlist autopostback property to TRUE and try
|
|
|
|
|
Change dropdown property autopostback to TRUE
|
|
|
|
|
Please note that you have an option to modify your message.
And what the PostBack property is going to do with the Question?
Regards,
Arun Kumar.A
|
|
|
|
|
Please don't use static unless you are sure that it will not create any side effect.
Consider the following program:
<code>static int i;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
i=i+1;
TextBox1.Text=i.ToString();
}
</code>
For each Button Click event, the value of "i" is incremented and displayed in the TextBox.
I have clicked the button 5 times and the text box shows 5 in it.
At this moment,when I opened another browse , copy - paste the same url
and I tried to click the button, it shows "6" in it.
So, I think that:
For the first request, an Object of the page is created and maintained in the server.
For subsequent request separate object is created for the page and is rendered to the Client,
and the static member is shared by all objects.
Regards,
Arun Kumar.A
|
|
|
|
|
Thanks a lot Arun..u understood my question..and answered precisely..
|
|
|
|
|
Facing prob in retriving data .
When a item is selected from dropdown its index value goes in database , now when i want to retrive value in front end
i m not able to do tht as backend has int value and dropdown in list item contains string value
|
|
|
|
|
for dropdown there is a ValueField and TextField. hold the int value in ValueField and use dropdown.SelectedValue
hope this is what u asked?
Biju S
|
|
|
|
|
You can convert that(string value) to Integer like this:
Convert.ToInt32("string value");
Apurva Kaushal
|
|
|
|
|
hi sneha,
Do u mean..you R unable to get the value at Front End
means..U want to display the value on the form at runtime
it is type cast error
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Thanks for u r replies ....... i have solved my problem ......Just by setting value field in list item editor to its index value .......
|
|
|
|
|
Hi!
I’m getting on buttonclick event following exception
Sys.Webforms.PageRequestManagerServerErrorException
When updatepanel is used in page.
Do you have any idea to solve this exception.
I tried a lot ,I got some ways to solve it Like
1) set EnablePartialRendering to false, but it is of no use bcoz whole page is getting refreshed ,to solve this issue only I’m using updatepanel.
<asp:scriptmanager id="ScriptManager1" runat="server" enablepartialrendering="false">
2)Set EnableEventVaildation=”false” not possible bcoz server side validation wont happen.
3)disabling cache in Role Manger in web.config
i put following code snippet in web.config
<rolemanager enabled="true" cacherolesincookie="false">
<providers>
<add
name="SQLOLEDB"
="" type="System.Web.Security.SqlRoleProvider" connectionstringname="ConnectionString" applicationname="MClosetURL">
but problem didnt get solved
4) I used javascript to catch the exception at client side in script tag in aspx page , In this case I’m not getting exception but nothing is happening after that ,server side click is not getting fired
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
if (args.get_error() != undefined)
{
var errorMessage;
if (args.get_response().get_statusCode() == '12031' || args.get_response().get_statusCode()=='12030' || args.get_response().get_statusCode() == '405')
{
args.set_errorHandled(true);
}
else
{
}
}
}
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
yogita charhate wrote: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
if (args.get_error() != undefined)
{
var errorMessage;
if (args.get_response().get_statusCode() == '12031' || args.get_response().get_statusCode()=='12030' || args.get_response().get_statusCode() == '405')
{
args.set_errorHandled(true);
}
else
{
}
}
}
This block should be below the ScriptManager. Check whether you placed it in the right place.
|
|
|
|
|
good morning venkatesh!!
Thank you for replying me, after much longer wait finally i got reply from someone. Actually the code I have put in my page is working
bcoz sys.webforms.... exception is not coming but server side event is not getting fired afte button click, Postback is not happening at all.
I have used script manager in master page and written code in script in the page
in which that error is comming.
Even if i tried putting this script below script manager in master page but nothng different happened.
I Think in the if condition of code below
is it enough to have statement args.set_errorHandled(true);
or something more is needed.
Pls guide I want button click event at server side should get fired after exception is handled by the following code which is not happening in my page .
thanks a lot again!
have a very nice day!!
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
if (args.get_error() != undefined)
{
var errorMessage;
if (args.get_response().get_statusCode() == '12031' || args.get_response().get_statusCode()=='12030' || args.get_response().get_statusCode() == '405')
{
args.set_errorHandled(true);
}
else
{
}
}
}
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
did anybody found the solution for this ?
i am also having similiar issue.
|
|
|
|
|
I want to draw your attention to the behaviour of a custom dropdown combobox such as one on:
http://www.codeproject.com/aspnet/ComboAdjustDropDownWidth.asp[^]
when the page containing it is loaded on a custom browser created using the WebBrowser Control that comes with Microsoft Visual Studio 2005. It is impossible to scroll using the vertical scrollbar. When you click on the scrollbar with an intention to scroll, it just closes. I tried this from a custom browser I created and also on another by Thomas Maxwell on Planet Source Code:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=10&txtCodeId=5484[^]
with the same result.
On IE, its scrolling ability is OK. Is it possible that Microsoft's WebBrowser control might have some deficiencies?
|
|
|
|
|
hi, my last post i have already find out how to add the record. and i manage to add the record into the Movie Table. now i hav another problem which is in my form the actor n director have a dropdown list for user to choose n if in the dropdown list the the actor cannot be found the user can type in the name. how am i goin to do the code to detact if the dropdown list is empty then go to the textbox n add the name that they have key in? below is my code which i have done so far. Thanks a lot 4 the help
Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Moviename
Dim Actorname
Dim Director
Dim Language
Dim Numberofdisc
Dim Studio
Dim ReleaseDate
Dim Price
Dim Quantity
Dim sql
Dim asql
Dim DBconn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("dvd_rental.mdb"))
DBconn.Open()
Moviename = Request.Form("txtmovieName")
Actorname = Request.Form("txtActorname")
Director = Request.Form("txtDirector")
Language = Request.Form("txtLanguage")
Numberofdisc = Request.Form("txtNoofdisc")
Studio = Request.Form("txtStudio")
ReleaseDate = Request.Form("txtReleaseDate")
Price = Request.Form("txtPrice")
Quantity = Request.Form("txtQuantity")
sql = "INSERT INTO Movie(MovieName, MovieLanguage, Numberofdisc, Studio, ReleaseDate, Price, Quantity) "
sql = sql & "VALUES('" & Moviename & "'"
sql = sql & ",'" & Language & "'"
sql = sql & ",'" & Numberofdisc & "'"
sql = sql & ",'" & Studio & "'"
sql = sql & ",'" & ReleaseDate & "'"
sql = sql & ",'" & Price & "'"
sql = sql & ",'" & Quantity & "')"
asql = "INSERT INTO Actor(Actor Name)VALUES('" & Actorname & "')"
Dim dbq As New OleDb.OleDbCommand
dbq.CommandType = CommandType.Text
dbq.CommandText = asql
dbq.Connection = DBconn
dbq.ExecuteNonQuery()
Dim dbquery As New OleDb.OleDbCommand
dbquery.CommandType = CommandType.Text
dbquery.CommandText = sql
dbquery.Connection = DBconn
dbquery.ExecuteNonQuery()
DBconn.Close()
DBconn = Nothing
Response.Redirect("WebAddResult.aspx")
End Sub
<title>WebAdd.aspx
function Table1_onclick() {
}
function Text1_onclick() {
}
<asp:label id="AddNewDvd" runat="server" width="240px" designtimedragdrop="8" font-bold="True" font-size="14pt" font-names="Times New Roman">Add new DVD Record | | | |
<asp:label id="Moviename" runat="server" width="112px" font-size="14pt">DVD Title: |
<asp:textbox id="txtmovieName" runat="server"> |
<asp:label id="Actor" runat="server" width="112px" font-size="14pt">Actor: |
<asp:dropdownlist id="DropDownList1" runat="server" datasourceid="AccessDataSource1"
="" datatextfield="Actor_Name" datavaluefield="Actor_Name" width="132px">
<asp:accessdatasource id="AccessDataSource1" runat="server" datafile="~/dvd_rental.mdb"
="" selectcommand="SELECT [Actor Name] AS Actor_Name FROM [Actor]">
<asp:textbox id="txtActorname" runat="server"> |
<asp:label id="Director" runat="server" width="112px" font-size="14pt">Director: |
<asp:dropdownlist id="DropDownList2" runat="server" datasourceid="AccessDataSource2"
="" datatextfield="Director_Name" datavaluefield="Director_Name">
<asp:accessdatasource id="AccessDataSource2" runat="server" datafile="~/dvd_rental.mdb"
="" selectcommand="SELECT [Director Name] AS Director_Name FROM [Director]">
<asp:textbox id="txtDirector" runat="server"> | <asp:label id="language" runat="server" font-size="14pt" width="112px">Language: | <asp:textbox id="txtlanguage" runat="server"> | <asp:label id="Numberofdisc" runat="server" font-size="14pt" width="145px">Number of Disc: | <asp:textbox id="txtNoofDisc" runat="server"> |
<asp:label id="Studio" runat="server" width="112px" font-size="14pt">Studio: |
<asp:textbox id="txtStudio" runat="server"> | <asp:label id="ReleaseDate" runat="server" font-size="14pt" width="112px">Release Date: | <asp:textbox id="txtReleaseDate" runat="server"> |
<asp:label id="Price" runat="server" width="112px" font-size="14pt">Price: |
<asp:textbox id="txtPrice" runat="server"> |
<asp:label id="Quantity" runat="server" width="112px" font-size="14pt">Quantity: |
<asp:textbox id="txtQuantity" runat="server"> | | |
<asp:button id="Submit" runat="server" text="Submit" onclick="Submit_Click"> | |
ling
|
|
|
|
|
what is the error you are getting?
Biju S
|
|
|
|
|
hi. i did nt get any error. but when i run n press the submit button the record is not added into the database. is my connection having problem?
thanks a lot 4 helping
ling
|
|
|
|
|
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hello everyone,
How can i make fastest website or program in ASP.NET
wht should include to make fastest website or program
Thnx in advance
|
|
|
|