|
I am using two update panels in the page. Following is the code:
<asp:updatepanel id="UpdatePanel1" runat="server" updatemode="Conditional" xmlns:asp="#unknown">
<asp:updatepanel id="UpdatePanel2" runat="server" updatemode="Conditional">
The first one fires on a textbox change which is working perfectly fine. The second one is to be fired on the change of a dropdownlist.
Eventhough the dataset contains data and binded to the dropdown list, the data is not displaying in the dropdown. Am I doing something wrong here?
When I removed the update panel and tried to execute, it is displaying correctly. Should there be a different value for the Update Mode? Anybody can provide any help on this? Thanks in advance for any help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: The second one is to be fired on the change of a dropdownlist.
So, did you call the UpdatePanel2.Update() ; from that dropdown list changed.
When you have changed the update mode of a updatepanel to conditional , you need to call the update method explicitly.
Hope this will clears your doubts
|
|
|
|
|
Yeah, I have done that. But still it is not firing. Following is my full code:
HTML Code:
------------
<td>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="CompanyList" CssClass="PCMSDropDown" runat="server" Height="22px" Width="155px" AutoPostBack="True" AppendDataBoundItems="true"
onselectedindexchanged="CompanyList_SelectedIndexChanged">
<asp:ListItem Selected ="True" Text="--Please Select--"></asp:ListItem>
</asp:DropDownList></ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress2" AssociatedUpdatePanelID="UpdatePanel2" runat="server" >
<ProgressTemplate>
<span class="ProgressBar">Data Loading.Please Wait....</span></ProgressTemplate>
</asp:UpdateProgress></td>
<td>
<asp:DropDownList ID="ProjectList" runat="server" CssClass="PCMSDropDown"
Height="23px" Width="155px"></asp:DropDownList></td>
Codebehind:
-------------
protected void CompanyList_SelectedIndexChanged(object sender, EventArgs e)
{
{
int CompanyId = Convert.ToInt32(CompanyList.SelectedValue);
Pcms.Business.Project p = new Project();
DataSet dsprojects = p.GetProjects_Companywise(CompanyId);
ProjectList.DataSource = dsprojects.Tables[0];
ProjectList.DataTextField = "ProjectName";
ProjectList.DataValueField = "ProjectId";
ProjectList.DataBind();
UpdatePanel2.Update();
}
}
Please correct me if I am doing wrong anything here.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
Thanks a lot. it's working perfectly fine now.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
I am really sorry that I checked the same when I remove the update panel and checked it in pure postback. But When I use the update panel it's firing but not populating. The dataset containst the data also. I checked it in Immediate Window and got the result. Any idea on this. Sorry for giving you the wrong information earlier.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi guys i am facing probs in session clear...,
In my login page i am checking, one value if its empty then i am killing the session using :
Session.Abondon();
If i use like this whenever i am logout my session are getting clear and in the same page if i once again login its redirecting to my login page only...,
in my second time login only i can able to enter my page...,
Instead of session.abondon if i clear the session like:
Session.Remove="";
After logout i can able to enter my login page in first time itself...,
whats the probs for using session.abondon();
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Session.Abandon() , Cancels the current session , Means The Abandon method destroys all of the session objects and releases their resources for that user.
If you check the session variable after that you will get Null object.
<br />
Session.Remove(strSessionName) , Remove an Item from Session State Collection . So Its only remove that particular item that you have mention on strSessionName .
Now about your problem,
Use Session.Abandon() at the time of Logoff. It will clear session data and destroy the objects , and While checking first time in login , check session variable first , if its null, redirect user to login page again
And If you are more interested on session just read Exploring Session in ASP.Net[^]
|
|
|
|
|
Member 3879881 wrote: whats the probs for using session.abondon();
You need to implement void Session_End(object sender, EventArgs e) of Global.asax
void Session_End(object sender, EventArgs e)
{
Session["varName"] = null;
}
|
|
|
|
|
i want to set the focus at the end of textbox on page refresh.
i am using timer control to refresh my page.
so when page get refresh the cusor should be at the end of textbox
|
|
|
|
|
dilip514 wrote: so when page get refresh the cusor should be at the end of textbox
You want to mean you have some text on textbox and focus will be end of that text ? please confirm .
|
|
|
|
|
How to transfer datas from one folder to another folder using ASp.net coding.pls help me with this,
thanks
Regards Arun..
|
|
|
|
|
Get the directory contents using Directory.GetFiles() . Iterate the collection and copy file one by one. You need to write a recursive search which will copy the subdirectories as well.
|
|
|
|
|
Have a look here. Copy file from one Dir to another[^]
This is vb.net code , hope you will get an idea how to implement in C#
ArunRevathy wrote: Subject: help me
Never put subject line like that . Always give proper subject, it will help you to get answer
|
|
|
|
|
Well, if the folders are on the server, it's trivial, and if they are on the client ( as I suspect you mean from the over all clueless air of your post ). it's not possible, buy a book, learn what ASP.NET, etc.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi everyone,
In my application I am trying to get the response from authorize .net ,if i am using http webresponse i am able to the respons from site like approved or failed etc but if i mention x_relay_url(return url is the page to where authorize .net will send the response) ,it is not able to come back to the page. I am using https://test.authorize.net/gateway/transact.dll for demo purpose, when i am submitting my transaction it is remaining in the same page(https://test.authorize.net/gateway/transact.dll) and giving message as
"An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card."
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.
So i am not able to get the reponse in my site only
pls can anybody help me its very urgent
|
|
|
|
|
Contact the authorize.net support people.
|
|
|
|
|
I have a gridview that is being dynamically populated with data based on textbox values at runtime. The code inside the button click is as follows:-
1 conn.Open();
2 string strSQL = "SELECT [UserId], [IsLockedOut] FROM [ac_Users] WHERE ([UserId] =" + Int32.Parse(tb_UserID.Text) + ")";
3 SqlCommand cmd = new SqlCommand(strSQL, conn);
4 DataTable dt = new DataTable();
5 SqlDataAdapter sqlAdapter = new SqlDataAdapter(null, conn);
6 sqlAdapter.SelectCommand = cmd;
7 sqlAdapter.Fill(dt);
8 conn.Close();
9 try
10 {
11 grd_Users.DataSource = dt.DefaultView;
12 grd_Users.DataBind();
13 pnl_Users.Visible = true;
14 }
15 catch (Exception ex)
16 {
17 TestUtils2.TestLogger.WriteErrorEntry(ex.Message, AuctivaUtils2.eAuctivaLogFile.General);
18 }
19 finally
20 {
21 conn.Close();
22 }
The gridview is correctly populated with the data I need, however I want each row in the data that is returned to be editable. I have the AutoGenerateEditButton property set to true and have also set the DataKeys property of the the gridview with the primary key of the table being returned.
However when I click the 'edit" link that appears in each row in the gridview, nothing happens. How do I make that button make the corresponding row editable ?
|
|
|
|
|
You should probably drop the line numbers and wrap your code in <pre></pre>...makes it easier to read. As for why edit doesn't work...I'd need to know more. Are you using an UpdatePanel/AJAX? How much data is bing bound? A few rows, or thousands? Volume can affect the performance of actions like edit sometimes.
|
|
|
|
|
I am not using any AJAX. the data being returned is not more than 10 rows.
|
|
|
|
|
Hi
I am creating a custom sever control. I have property with name selected color i wana bound this property with Color editor. So user can select color in color window any who can help me.
Thanks
Vicky
|
|
|
|
|
In design time correct? If you use Color[^] structure, the IDE will show color picker.
|
|
|
|
|
I would like to load pages according to the value selected within a list, for example:
<code>
protected void Button2_Click(object sender, EventArgs e)
{
if (lstTaskCategory.Text.Equals("User Experience")) {
//Load Task_entry_2_user_experience.aspx
}
else if (lstTaskCategory.Text.Equals("Localization")) {
//Load Task_entry_2_localization.aspx
}
else if (lstTaskCategory.Text.Equals("Documentation") {
//Load Task_entry_2_documentation.aspx
}
}
</code>
More questions...
Is it also possible to do the above as a dynamic hyperlink (i.e. have a hyperlink that automatically updates a value within
<a href="page.aspx"> Next </a>.
In my case the value of <page.aspx> would change according to the value in lst.TaskCategory.Text.
Jon
|
|
|
|
|
Well, for starters you could use a switch statement. If it's a list, you could also use the data field to store the URLs.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|