|
rock_mre wrote: I am need speed help !
So do we, like more information on what is happening?
Formerly know as .netman
|
|
|
|
|
I have a dropdownlist whose items are populated dynamically on a button click. I have a gridview being populated with values depending on the value selected in the dropdown list. The problem is that each time the SelectedIndexChanged event is fired the items in the drop down list are duplicated. I cannot use a if(!Page.Postback) block around the dynamic creation of the dropdown's list of items because that occurs on a button click so the page needs to be posted back the first time otherwise the items won't populate.
Also, once it duplicates the items if I click on any of the items in the list ... the dropdownlist completely disappears from the page.
Any ideas on what I should do ?
modified on Thursday, October 16, 2008 5:54 PM
|
|
|
|
|
can you test if your dropdownlist has items before adding new items? otherwise skip adding...
other than that, if AutoPostback of the dropdownlist is set to false, it wont refresh the page
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
Cyberpulse wrote: I cannot use a if(!Page.Postback) block around the dynamic creation of the dropdown's list of items because that occurs on a button click so the page needs to be posted back the first time otherwise the items won't populate.
Clear the DropDownList Items everytime using MyDropDown.Items.Clear()
|
|
|
|
|
I was learning how use localization in the web sites by reading "Walkthrough: Using Resources for Localization in ASP.NET" from the Help in VS2005.
This Walkthrough talk about localization of controls in Design view.
But, how can I localize the controls I add to the web site programmatically?
Thank you in advance.
[Adrián Córdoba]
|
|
|
|
|
I am attempting to assign a skin value to a control in a test method after the Page_PreInit event and my code errors "skinID can not be set after the Page_PreInit event". The test method is below:
private void UpdateCMLibraryInformationBackColor()
{
for (int j = 0; j < 4; j++)
{
for (int i = 1; i < 10; i++)
{
((WebControl)GridViewCMLibraryInformation.Rows[j].Cells[i].Controls[1]).SkinID = "";
}
}
for (int i = 1; i < 10; i++)
{
((WebControl)GridViewCMLibraryInformation.Rows[Convert.ToInt32(FieldCMLibraryUpdatedIndex.Value)].Cells[i].Controls[1]).SkinID = "SelectedHighlite";
}
Does anyone have a suggestion to allow me to be able to do this?
Thanks,
Steve
|
|
|
|
|
I did solve the problem. Instead of using a .skin I just used a css which can be implemented after the Page_PreInit.
|
|
|
|
|
have a grid with LINQ taking care of the update/delete transactions for me. Looking at http://msdn.microsoft.com/en-us/library/bb298529.aspx, I want to setup my optimistic concurrency to overwrite current values. I open 2 instances of the same application and edit the same record. My code catches the concurrency problem in the GridView1_RowUpdated method. Problem is how to resolve it.
Since I have a datagrid with a linqDataSource, I do not have a northwind db = new northwind() in my code. So I created a new instance within teh GridView1_RowUpdated method, but I don't believe this was correct. Therefore, I'm confused how to implement the code below if I'm using a GridView and LINQ to control my edit/delete function?
***Here is my code...I think by creating a new northwindDataContrext on the fly is incorrect b/c it's a new instance that does not have the Concurrency Error...which is the reason my metatables are not returning any information on conflict either.****
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
ErrorMessage.Text = "";
if (e.Exception != null && e.Exception.GetType() == typeof(ChangeConflictException))
{
NorthwindDataContext db = new NorthwindDataContext(); **I think this may be incorrect**
foreach (ObjectChangeConflict occ in db.ChangeConflicts)
{
occ.Resolve(RefreshMode.OverwriteCurrentValues, true);
//be sure to add *** using System.Data.Linq.Mapping;
MetaTable metatable = db.Mapping.GetTable(occ.Object.GetType());
MyProduct entityInConflict = (MyProduct)occ.Object;
Label1.Text = "Table name: " + metatable.TableName;
Label1.Text = Label1.Text + "Customer ID: " + entityInConflict.ProductID;
}
ErrorMessage.Text = "Someone changed this record while you were working on it.";
e.ExceptionHandled = true;
e.KeepInEditMode = false;
}
}
****Here is the MSDN code http://msdn.microsoft.com/en-us/library/bb298529.aspx,***
Northwnd db = new Northwnd("...");
try
{
db.SubmitChanges(ConflictMode.ContinueOnConflict);
}
catch (ChangeConflictException e)
{
Console.WriteLine(e.Message);
foreach (ObjectChangeConflict occ in db.ChangeConflicts)
{
// All database values overwrite current values.
occ.Resolve(RefreshMode.OverwriteCurrentValues);
}
}
Thank you
|
|
|
|
|
I am writing a load balancer for my web farm. Each request made to my web application need to go though the load balancer, which will first check availability of host machine and will then route request to available machine. Now my web-applilcation is using forms that need to post back to server. Again load balancer need to intercept this post-back to see which machine is available and then route this request to that machine.
http://MyLoadBalancerIP/MyApp -> http:// FirstHostMachineIP/MyApp
http://MyLoadBalancerIP/MyApp -> http:// SecondHostMchineIP/MyApp
Any idea how this could be done?
|
|
|
|
|
|
Hi all,
Can anybody help me to print the repeater data from asp.net page? I am binding two columns of the table in repeater. It is including the background color, which is fetching from the database. I am really stucked in this. Some javascript functions not printing the color or the table.
My repeater is below.
<asp:Repeater ID="repeaterTT" runat="server">
<HeaderTemplate>
<Table border="1px" id="tblTT" cellpadding="0" cellspacing="0" style="border-color:Black;"
width="100%">
<tr>
<th>
Location</th>
<th>
Times</th>
<th>
Sunday</th>
</tr>
<tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="center">
<%# DataBinder.Eval(Container.DataItem, "facility_name")%>
</td>
<td align="center">
<%# DataBinder.Eval(Container.DataItem, "TT_TIME")%>
</td>
<td align="center"
style='background-color:<%# DataBinder.Eval(Container.DataItem, "session_color")%>'>
<%# DataBinder.Eval(Container.DataItem, "session_sun")%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
|
|
|
|
|
|
Use order by clause in select query
|
|
|
|
|
hey please tell me the exact orderby query...
thanx..
|
|
|
|
|
Ordering by assceding
select * from tablename order by columnname ASC
Ordering by desceding
select * from tablename order by columnname DESC
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
This guy keeps posting the same question in multiple forums and has no clue how to use Google.
Blog link to be reinstated at a later date.
|
|
|
|
|
thnanx a lot friends..my problem was solved..
|
|
|
|
|
You are a complete tool.
Blog link to be reinstated at a later date.
|
|
|
|
|
My Paranoid Hubby wrote: a complete tool.
Yep. Should have seen the questions the OP was asking about not being able to see SQL Server, and the walk through how to work with Services.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have a gridview where each row's cells contain textboxes (for providing I/O into the gridview) The problem I need to solve, I think, is with textboxes that make up the cells of the grid. When I select one of the textboxes that make up the cells of the gridview, then I want the whole row, each of the row's textboxes, to be highlighted in yellow showing that row as being selected.
Thanks,
Steve
|
|
|
|
|
Steve, ever heard of theDataGrid Girl?[^] For everything you wanted to know about the asp.net datagrid.
led mike
|
|
|
|
|
A great resource. It has helped me with many problems. Shame about the name
Bob
Ashfield Consultants Ltd
|
|
|
|
|
The problem I was having was not being able to set a skin dynamically to a control after Page_OnInit. I posted a new question coving that so just disregard this.
Thanks,
Steve
|
|
|
|
|
Hey.
I have a search page containg 2 buttons and 2 textboxes.
I have a javascript that cathces the enter-key event and triggers the respecting button, as
in TextBox1 to Button1 and TextBox2 to Button2.
My problem is that when I enter the page, the Button2 is allways in focus, no mather if I have the TextBox1 in focus or
click on a CheckBox that is allsow have on the page.
So when I hit the enter-key, the Button2.click event is allways triggerd.
Does anyone know how to get around this.
Thanks
Thomas
|
|
|
|
|
I had to replace the Buttons with LinkButtons
|
|
|
|