|
Hi,
I have listview with itemtemplates. so listview's each row is in the format as
<checkbox><Label><checkbox><HiddenField>
In design it looks similar to as
asp:ListView ID="ListviewSelectedBaseLayers" runat="server" DataKeyNames="Layer_ID">
..
..
<ItemTemplate>
<tr id="check_1">
<td style="text-align: center">
<asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true" />
</td>
<td>
<asp:Label ID="lblLyrName" runat="server" Text='<%#Eval("LayerName")%>' ></asp:Label>
</td>
<td style="text-align: center">
<asp:CheckBox ID="chkDefaultlayer" runat="server" AutoPostBack="true" Checked='<%#Eval("DefaultLayer")%>' />
</td>
<td style="display:none">
<asp:HiddenField ID="hdRank" runat="server" Value='<%# Eval("Rank") %>' />
</td>
</tr>
</ItemTemplate>
Now when I click on checkbox or the label, listview's selected row does not hilight.
How to achieve this? I tried by toggling the colour of the table covering table row by putting onclick javascript for the label.
Did not find enough information on this ? So if anybody give some tips will really help.
thanks
vijay
|
|
|
|
|
You can do it through the onclick event of the tr element. Here's a simple snippet of what you might want to do.
<tr style="border:solid 1px Black;" onclick="ToggleColor(event);">
And on the function
function ToggleColor(ev) {
var tar;
if (ev.srcElement != null) {
tar = ev.srcElement.parentElement;
}
else {
tar = ev.currentTarget;
}
if (tar.bgColor == "#eeeeee") {
tar.bgColor = "#ffffff";
}
else {
tar.bgColor = "#eeeeee";
};
}
Hope this helps.
Walter
|
|
|
|
|
if you can make the list view render as divs I think you can use jQuery Highlight[^] Effect. good luck
|
|
|
|
|
Hi,
I've got a MasterPage and another page Default.aspx
In the MasterPage there's a form to make the server side controls run.
In Default.aspx there are a lot of Inputs and I need to send that data to another page (Exec.aspx)
I tryed adding another form in Default.aspx, but it doesn't appear in the HTML, so I decided to change the action of the form in the MasterPage.
I Used this code:
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs)
CType(Me.Master.FindControl("Form1"), HtmlForm).Action = "Exec.aspx"
End Sub
But it raises an error:
"Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."
What can I do???? Please help me!
PS: I can't send the data by GET method
|
|
|
|
|
|
You are right, but I would like to send the data to another page that handles tha data and does other things.
However, thanks for your advice, but I solved the problem creating a third page and requesting it via AJAX.
|
|
|
|
|
95ulisse wrote: I solved the problem creating a third page and requesting it via AJAX
Of course, every problem can be solved by another level of indirection
Just because you can doesn't mean you should. Design the solution correctly and it will limit your problems in the future.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You are right, but in this way my page doesn't need to refresh
and I think it's better for the user!
|
|
|
|
|
You don't need a third page to make use of AJAX. You are adding complexity where it is not necessary which will make your application more difficult to maintain and enhance.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I have a checkboxlist which is databound in code behind.
chkListBaseMaps.DataSource = oDataSet
chkListBaseMaps.DataTextField = "LayerName"
chkListBaseMaps.DataValueField = "Layer_ID"
chkListBaseMaps.DataBind()
I get the checkboxlist ordered on Layer_ID.
I delete/insert items in checkboxlist and do the same with associated dataset and bind the chklistbox again.
What I need is everytime I bind the checkboxlist, i need the checkboxlist to be ordered (sorted as ASC) on LayerName field which is datatextfield. How to do that?
thanks
vijay
|
|
|
|
|
Why not use DataView to associate with checkboxlist and bind it?
Do all you need with dataview... sorting... filtering!
Thus, this line would change: chkListBaseMaps.DataSource = oDataSet oDataView
|
|
|
|
|
Yep helped it
Thanks a lot
vijay
|
|
|
|
|
So i worked about a year with asp.net with vs 2003 and .net2.
Looking to restart where i left with the brand new vs 2010 with asp.net webforms (mvc looks too different and i am a bit tight on time to relearn the whole thing).
However my deployment server is a Windows Server 2003, can i work with VS 2010 asp.net webform project or would it be better for me to downgrade to a previous version of Visual Studio?
Thanks in advance
|
|
|
|
|
Or maybe this is a better way of phrasing this,
Is there a way to target IIS 6 with Visual Studio 2010?
|
|
|
|
|
Hi,This is first time that i am trying to connect to an OPC server(KEP and MATRICON). I dont have any idea about it, so please can anybody guide me through how to connect to an OPC server(KEP and MATRICON) & fetch values from it. I am using ASP.net with C#.
Thanks in advance.
modified on Tuesday, June 1, 2010 8:03 AM
|
|
|
|
|
Dear friends,
I want to fetch data from Excel sheet sheet1 using ASP.NET with C# and store the data in SqlServer database table using BulkCopy method. I am able to fetch complete excelsheet data, but I want only some rows. I want sql statement to fetch the data. Excel sheet contains one Date column. I want to fetch data from only particular dated rows. I am writing the following query
select * from [Sheet1$] where Date=21/04/10 It is giving me error datatype mismatch. Please, can anyone help me. It's very urgent. Pls....
Thanks,
Dileep.
|
|
|
|
|
Try the following query:
select * from [Sheet1$] where Date='04/21/2010'
Note that the date should be in mm/dd/yyyy format and within single quote(').
|
|
|
|
|
Dear Anurag,
I am still getting this following error.
[System.Data.OleDb.OleDbException] = {"Data type mismatch in criteria expression."}
I have written the following code.
filename = path + "SS_EmpLoginTimings.xls";
string s = "provider=Microsoft.Jet.OLEDB.4.0;" + @"data source=" + filename + ";Extended Properties=Excel 8.0;";
OleDbConnection con = new OleDbConnection(s);
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter("select * from [Sheet1$] where Date='04/21/2010'", con);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
BulkCopyData(dt, "SS_EmpLoginTimings");
public bool BulkCopyData(DataTable dt, string tblName)
{
SqlBulkCopy bulk = new SqlBulkCopy(conn);
bulk.DestinationTableName = tblName;
conn.Open();
bulk.WriteToServer(dt);
conn.Close();
return true;
}
Please help me. It's very urgent. I need to finish this work by today evening. Pls pls pls...
Regards,
Dileep.
|
|
|
|
|
Have you got da and ds the wrong way round in the da.fill(ds)?
It's while since I coded anything like this so I could be totally wrong.
Maybe try putting the criteria as Date = '21-Apr-2010'.
|
|
|
|
|
|
How consistant is the data in your spreadsheet? Do all of the rows have dates in the date column? The Excel database driver determines the datatype of each column by the values in the first 10 rows. If your first ten rows have nothing in the date column or have other text like N/A or -, then that column will not be considered a date and you can't query it like a date.
|
|
|
|
|
Dear friend,
All the rows in that column are having date only. I don't know what's wrong. I have tried in many ways. I am getting the following error.
[System.Data.OleDb.OleDbException] = {"Data type mismatch in criteria expression."}
Since last day afternoon, I am struggling for this. I have written queries in all following possible ways.
select * from [sheet1$] where LoginDate='21/04/10'
select * from [sheet1$] where LoginDate='21/04/2010'
select * from [sheet1$] where LoginDate='21-04-10'
select * from [sheet1$] where LoginDate='21-04-2010'
select * from [sheet1$] where LoginDate='21-Apr-10'
select * from [sheet1$] where LoginDate='21-Apr-2010'
select * from [sheet1$] where LoginDate='04/21/10'
select * from [sheet1$] where LoginDate='04/21/2010'
select * from [sheet1$] where LoginDate='04-21-10'
select * from [sheet1$] where LoginDate='04-21-2010'
select * from [sheet1$] where LoginDate='Apr-21-10'
select * from [sheet1$] where LoginDate='Apr-21-2010'
select * from [Sheet1$] where [LoginDate] = '"+DateTime.Parse("04-21-10").ToString()+"'"
select * from [Sheet1$] where [LoginDate] = '"+DateTime.Parse("04-21-10")+"'"
Still I am not getting. Can anyone, pls help me. It's very urgent.
Regards,
Dileep
|
|
|
|
|
Thanks friends,
I have got it in another way.
select * from [sheet1$] where LoginDate=#21/04/10#
It's working fine.
Thanks everyone.
Regards,
Dileep.
|
|
|
|
|
how to type the same number in a single column?
|
|
|
|
|
Can you be a little more elaborate? We cannot read your mind to guess of what you can be talking!
|
|
|
|