|
Hi,
I have a listview control in which I have 4 templates, one among them is InsertTemplate. Under which I have two drop down lists for country and state. Which are using ajax postback and which has update panel for them. ListView Item created event and country drop down selected index changed event.
If I dont put !ispostback condition for page load and itemcreted events, the index is not changing for the country. If I put that condition to load the country drop down list, the drop down list is not populated.
If I put !ispostback condition for only page load event, then all the items of the listview are cleared automatically.
Please help me I want to access and populate country drop down list and depending upon the selected country I want to populate the state list.
Please help me I am in desperate need. I am googling it but not finding good help yet.
Any links are also helpfull please.
Thanks,
Abdul
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
You do the initial load of data on page.load if not postback - The example is vb, but you should be able to change it to c# with ease. The update panel doesn't matter, because the principals are the same.
Sub Protected Page.Load( ffdfgdffg )
if Not Page.IsPostback Then
Load Dropdowns with countries
End If
End Sub
Make sure autopostback is set to true on the Country ddl
Then on postback when the user selects a country
Protected Sub onCountry_Changed( fsdfsdf )
if Page.IsPostBack Then
iSelect = ddlCountry.SelectedValue
Load States Dropdown List( iSelect )
End If
End Sub
When a page first loads, the page lifecycle is called load. The page can only load once upon first creation.
When the page is sent back to the server, it's called a postback. The the server sends the page back again to reflect the change. The page can post back many times, and the markup will remain the same.
|
|
|
|
|
Always Send In The Code Snippet You Wrote..
It Helps To Get Solution Fast & Accurate
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
Hi there, I know this is asked many times, but I still did not get the code.
What I want to do is to show the rating from the tinyint column from the SqlDataSource I have on my page.
(I did not get the explanation of the MetalAsp.Net's comment here: http://forums.asp.net/t/1783225.aspx/1)
Also async update of the rating in the same database.
Please help. Thank you.
|
|
|
|
|
I populate the aspx page from the database and gridview that is selected. Not all data is editable so some items are not used to populate the editable page. Alas, there in lies the crux of the problem.
I need one of the values from the selected row in the grid to be held for later use in a client side javascript. My client does not want to see it on the aspx page.
My programming partner initially put it in a textbox.visible = false. Appearently that 'invisible' field is also invisible to javascript.
Other developers in the past have hinted at 'hiding' values on the aspx page.
How do I do that?
Thanks in advance..
chuck.
|
|
|
|
|
MacIntyre wrote: I need one of the values from the selected row in the grid to be held for later use in a client side javascript.
How about puttin' it in a cookie?
Bastard Programmer from Hell
|
|
|
|
|
Good solution except manager says no to cookies.... Thanks..
|
|
|
|
|
.visible tells the server to not render the tag. Use the css tag
.css = "display: none;"
|
|
|
|
|
Use Hiiden Variables for this sake..
Work on .Value Property of hiddenvariable
- Happy Coding -
Vishal Vashishta
|
|
|
|
|
Hii all.....
i am getting dis error
Execution of request failed: https://picasaweb.google.com/data/feed/api/user/prema8885@gmail.com/albumid/Hiiiiiiiiii?kind=photo&access=public
while retriving photos from album from picasa in asp.net application..
How to solve this? Any idea?
|
|
|
|
|
hi, I am using an aspxbutton and webmodalanchor for opening a new pop up page.I am opening the page but when I want to close the page, the page is being closed two times.I think the page loading two times If I use an aspxhyperlink the page, is being closed normally.But ı want to use aspxbutton. Thanks..
|
|
|
|
|
Error 3 Metadata file 'F:\Tolet_05APR2012\BusinessLayer\bin\Debug\BusinessLayer.dll' could not be found Tolet
|
|
|
|
|
Is the file there or not?
V.
|
|
|
|
|
Error 1 A namespace does not directly contain members such as fields or methods F:\Tolet_05APR2012\BusinessLayer\BALtbl_Registration.cs 9 5 BusinessLayer
|
|
|
|
|
You cannot use fields or methods from a namespace directly.
eg. you have following class.
namespace ns_a{
public class A{
public string Str_a { set; get; }
public string method_a(){
return "one funky string here";
}
}
}
if you want to call field Str_a or method method_a from a class B you'll need to instantiate the class and call it from there:
namespace ns_b{
public class B{
public method_b(){
string str_b = ns_a.Str_a;
string result_b = ns_a.method_a();
ns_a.A class_A = new ns_a.A();
string str_b2 = class_A.Str_a;
string result_b2 = class_A.method_a();
}
}
}
Hope this helps. This is pretty basic stuff, are you following classes or reading a book?
V.
|
|
|
|
|
Hi,
I am working on an Asp.net MVc web application.In my application on dropdown change i am submiting form (calling a controller method), and in controller method I am assigning value to a Tempdata .From that controller, call will be redicted to aspx page where I will access that tempdata (which is assigned in the controller).Here I am facing the problem as my Tempdata value is coming as empty but If I keep an alert in jquery or debug the application I am able to get the tempdata value.So not able to understand what exactly is the problem?Can anyone please help me on this? tried putting Tempdata.keep() also but did nt work.
Thanks,
Vanita
|
|
|
|
|
im using microsoft visual c# express and its database.
through my c# program i wanted to retrieve a folder path from the database to select files.but im getting this error.please help.
i have created a column 'folder_path nvarchar(50)'
my folder path is : @"f:/pick_up"
if i put folder path as 'comp' it reads.i guess the error has something to do with special characters @,/ and ".
reply asap.thank you.
|
|
|
|
|
Please, pick one forum and stick with it. Don't cross post.
|
|
|
|
|
I am given an ASP.NET project. There is a page with export to excel button. I am shown that the export to excel button works in a machine with office installed and visual studio installed.
Now the project is moved to a new server. It has only IIS. The project works, but the export to excel does not work. I look at the connection string and find out it refers to Microsoft Jet. Could it be that I need to install Microsoft Jet to the new server?
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strNewPath & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=2"""
|
|
|
|
|
Hi,
Provider=Microsoft.Jet.OLEDB is a driver and it exists in every machine which has .Net framework installed but in order to export to Excel the machine needs to have Office Excel installed.
|
|
|
|
|
May I assume that you mean the client machine needs to have Excel installed?
|
|
|
|
|
Absolutely no. The exportation occurs in the app server so I mean your server needs to have Excel installed.
|
|
|
|
|
I have an error page set up and when an error occurs the page is not shown.
From my webconfig file:
<customErrors defaultRedirect="~/Error.aspx" mode="RemoteOnly">
<error statusCode="404" redirect="~/Error.aspx" />
<error statusCode="500" redirect="~/Error.aspx" />
</customErrors>
From my Global aspx file:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastError().GetBaseException()
Try
If Not System.Diagnostics.EventLog.SourceExists(".NET Runtime") Then
System.Diagnostics.EventLog.CreateEventSource(".NET Runtime", "Application")
End If
Dim log As New System.Diagnostics.EventLog()
log.Source = ".NET Runtime"
log.WriteEntry([String].Format(vbCr & vbLf & vbCr & vbLf & "Application Error" & vbCr & vbLf & vbCr & vbLf + "MESSAGE: {0}" &
vbCr & vbLf + "SOURCE: {1}" & vbCr & vbLf + "FORM: {2}" & vbCr & vbLf + "QUERYSTRING: {3}" &
vbCr & vbLf + "TARGETSITE: {4}" & vbCr & vbLf + "STACKTRACE: {5}" & vbCr
& vbLf, ex.Message, ex.Source, Request.Form.ToString(), Request.QueryString.ToString(), ex.TargetSite, _
ex.StackTrace), System.Diagnostics.EventLogEntryType.[Error])
Server.ClearError()
Catch
Server.ClearError()
End Try
Server.ClearError()
Response.Redirect(String.Format("Error.aspx?aspxerrorpath={0}", Request.Url.PathAndQuery))
End Sub
What I end up seeing is the master page and the URL shows / Error.aspx, but the error page is not shown with it.
|
|
|
|
|
It seems that everything is fine but the address of Error.aspx is wrong as you say 'master page and the URL shows / Error.aspx'. I guess you must work on the last line:
Response.Redirect(String.Format("Error.aspx?aspxerrorpath={0}", Request.Url.PathAndQuery))
maybe you must replace it with "~/Error.aspx..."
|
|
|
|
|
How to do impersonation programatically in vb.net to access Windows Task scheduler's job status?
|
|
|
|