when i enter value greater than 15 in textbox calculation is not working - html

--source code--
<table style="border: thin ridge #000000; width: 72%; margin-top: 21px; margin-left: 243px;"
bgcolor="#CCCCFF">
<tr align="center">
<td class="style11">
</td>
<td class="style2">
</td>
<td class="style4">
</td>
<td class="style17">
</td>
</tr>
<tr>
<td class="style14">
</td>
<td class="style15" align="center">
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" Text="0.125"
oncheckedchanged="CheckBox1_CheckedChanged1" CausesValidation="True" />
</td>
<td class="style16" align="center">
<asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" Text="0.25"
oncheckedchanged="CheckBox2_CheckedChanged" CausesValidation="True" />
</td>
<td class="style18">
</td>
</tr>
<tr align="center" style="background-color:Fuchsia;">
<td class="style11">
L</td>
<td class="style2">
B
</td>
<td class="style4">
W</td>
<td class="style17">
N</td>
</tr>
<tr align="center" style="background-color:Fuchsia;">
<td class="style12">
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="115px" TabIndex="1" ></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td class="style7">
<asp:UpdatePanel ID="UpdatePanel5" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox2" runat="server" Width="115px" TabIndex="2"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td class="style9">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox3" runat="server" Width="115px" AutoPostBack="True"
ontextchanged="TextBox3_TextChanged" TabIndex="3"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td class="style19">
<asp:UpdatePanel ID="UpdatePanel6" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox4" runat="server" Width="115px" TabIndex="4"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr><td class="style13"></td><td class="style8">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
</td>
<td class="style10">
</td><td class="style20"></td></tr>
<tr align="right" style="background-color:snow;">
<td class="style3" colspan="2">
<asp:TextBox ID="TextBox7" runat="server" Width="142px"></asp:TextBox>
</td>
<td align="left" class="style4">
Price</td>
<td class="style17">
</td>
</tr>
<tr align="center">
<td class="style3" colspan="2">
</td>
<td align="left" class="style4">
</td>
<td class="style17">
</td>
</tr>
<tr align="center">
<td class="style3" colspan="2" align="right">
<asp:Button ID="Button3" runat="server" onclick="Button3_Click"
Text="Calculate" CausesValidation="False" />
</td>
<td align="left" colspan="2">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="Calculate" />
<input type="hidden" runat="server" id="hid" /></td>
</tr>
</table>
--code behind--
protected void Button1_Click(object sender, EventArgs e)
{
l = Convert.ToDecimal(TextBox1.Text);
b = Convert.ToDecimal(TextBox2.Text);
w = Convert.ToDecimal(TextBox3.Text);
n = Convert.ToDecimal(TextBox4.Text);
price = Convert.ToDecimal(TextBox7.Text);
avg = (l * b * w * n) / 4;
tot = avg * price;
try
{
string ins = "insert into cal_tbl(l,b,w,n,price,average,total)values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox7.Text + "','" + avg.ToString("#,0.00") + "','" + tot.ToString("#,0.00") + "')";
SqlCommand cmd = new SqlCommand(ins, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Bindgrid();
}
catch (Exception ex)
{
}
clearcontrols();
}
Now the problem is when i enter a value greater than 15 in textbox7(price) my calculation is not working and the value is not saving in database...help me solve that.
I have defined all columns as decimal datatype in sql.Is there any problem in that?

You should remove all ' in query. Because all columns are decimal. And should use .ToString("0.00")
string ins = "insert into cal_tbl(l,b,w,n,price,average,total)values(" + TextBox1.Text + "," + TextBox2.Text + "," + TextBox3.Text + "," + TextBox4.Text + "," + TextBox7.Text + "," + avg.ToString("0.00") + "," + tot.ToString("0.00") + ")";

Related

Old asp project text with overflow

I need to make a old asp project compatible with Chrome.
This is the html:
<table class="tabellaricercasmall" width="100%" height="5%" border="0">
<tr>
<%--<td class="welcome" width="45%">Società</td>
<td>
<asp:DropDownList ID="Societa" runat="server" AutoPostBack="false" Width="100%"></asp:DropDownList>
</td>--%>
<td class="welcome" width="15%">Matricola</td>
<td Width="15%">
<asp:TextBox ID="Matricola" runat="server" MaxLength="10" Columns="12" Width="100%" ></asp:TextBox>
</td>
<td class="welcome" Witdh="50%">Nominativo</td>
<td Width="20%">
<asp:TextBox ID="nominativo" runat="server" MaxLength="50" Columns="20" Width="100%" ></asp:TextBox>
</td>
<td class="welcome" width="20%">Codice Fiscale</td>
<td Width="20%">
<asp:TextBox ID="CodFiscale" runat="server" Columns="32" MaxLength="16" Width="100%" ></asp:TextBox>
</td>
</tr>
<tr>
<td class="welcome" width="15%">Periodo Da.</td>
<td>
<asp:DropDownList ID="DataDaDropDownList" runat="server" width="100%"/>
</td >
<td class="welcome" >Periodo A.</td>
<td>
<asp:DropDownList ID="DataADropDownList" runat="server" width="100%"/>
</td>
</tr>
<tr>
<td colspan="6">
<asp:Button ID="Button2" runat="server" Text="Cerca" CssClass="inputbutton" OnClick="Button1_Click1" />
</td>
</tr>
</table>
Here the results:
The top result (with the correct result) is internet explorer 11.
as you can see on chrome the text width is incorrect.
There is a way to fix ?
Thanks !

Remove space on a table cell for a nested Table

I'm trying to do a nested-table I'm about to be finish on my first table
when this happen:
here Is my HTML markup:
<table class="quotationTable1">
<%--Primary table--%>
<tr>
<td>
<table>
<%--Second Table--%>
<tr>
<td style="width: 397px">
<table style="border-style: solid; border-color: inherit; border-width: medium; width: 452px;">
<%--Third Table--%>
<tr>
<th colspan="2" style="padding-top: 5px; background-color: black; color: white;">Job Quotation</th>
</tr>
<tr>
<td colspan="2" style="height: 26px;">
<asp:Label ID="lblDescCategory" runat="server" Text="Category:"></asp:Label>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="labelDescType" runat="server" Text="Type:"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td style="width: 265px">
<asp:Label ID="lblDescAddress" runat="server" Text="Address:"></asp:Label>
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td style="width: 202px">
<asp:Label ID="lblDescContacts" runat="server" Text="Contacts:"></asp:Label>
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="height: 3px">
<asp:Label ID="lblDescJobdesc" runat="server" Text="Job Description:"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="height: 59px">
<asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Label5" runat="server" Text="File: "></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Label7" runat="server" Text="Finishing:"></asp:Label></td>
</tr>
</table>
</td>
<td>
<table style="width: 373px; position:relative;"><%--fourth table--%>
<tr>
<th colspan="3" style="padding-bottom:5px; background-color: black; color: white; width: 400px;">Specification</th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
How can I make my second table Specification remove all those spaces and
be on the same position as Job Quotation?
you need to add vertical-align:top to td
and don't use inline styles, use classes instead
td {
vertical-align: top
}
.w400 {
padding-bottom: 5px;
background-color: black;
color: white;
width: 400px
}
.w397 {
width: 397px
}
.w397 table {
border-style: solid;
border-color: inherit;
border-width: medium;
width: 452px
}
.w397.title {
padding-top: 5px;
background-color: black;
color: white;
}
.w373.relative {
width: 373px;
position: relative
}
.h59 {
height: 59px
}
.h26 {
height: 26px
}
.h3 {
height: 3px
}
<table class="quotationTable1">
<tr>
<td>
<table>
<tr>
<td class="w397">
<table class="w397 table">
<tr>
<th colspan="2" class="w397 title">Job Quotation</th>
</tr>
<tr>
<td colspan="2" class="w397 h26">
<asp:Label ID="lblDescCategory" runat="server" Text="Category:"></asp:Label>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="labelDescType" runat="server" Text="Type:"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="w265">
<asp:Label ID="lblDescAddress" runat="server" Text="Address:"></asp:Label>
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="w202">
<asp:Label ID="lblDescContacts" runat="server" Text="Contacts:"></asp:Label>
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" class="h3">
<asp:Label ID="lblDescJobdesc" runat="server" Text="Job Description:"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" class="h59">
<asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Label5" runat="server" Text="File: "></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Label7" runat="server" Text="Finishing:"></asp:Label>
</td>
</tr>
</table>
</td>
<td>
<table class="w373 relative">
<tr>
<th colspan="3" class="w400">Specification</th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
You need to nest the table in a TR and TD within the parent table:
<table class="quotationTable1">
<%--Primary table--%>
<tr>
<td>
<table>
<%--Second Table--%>
<tr>
<td style="width: 397px">
<table style="border-style: solid; border-color: inherit; border-width: medium; width: 452px;">
<%--Third Table--%>
<tr>
<th colspan="2" style="padding-top: 5px; background-color: black; color: white;">Job Quotation</th>
</tr>
<tr>
<td colspan="2" style="height: 26px;">
<asp:Label ID="lblDescCategory" runat="server" Text="Category:"></asp:Label>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="labelDescType" runat="server" Text="Type:"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td style="width: 265px">
<asp:Label ID="lblDescAddress" runat="server" Text="Address:"></asp:Label>
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td style="width: 202px">
<asp:Label ID="lblDescContacts" runat="server" Text="Contacts:"></asp:Label>
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="height: 3px">
<asp:Label ID="lblDescJobdesc" runat="server" Text="Job Description:"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<table style="width: 373px; position:relative;"><%--fourth table--%>
<tr>
<th colspan="3" style="padding-bottom:5px; background-color: black; color: white; width: 400px;">Specification</th>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" style="height: 59px">
<asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Label5" runat="server" Text="File: "></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Label7" runat="server" Text="Finishing:"></asp:Label></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

I want to create multiple columns in row(three columns) between rows(contains two columns) in html. how to do this?

Please guide. Image is attached.
I want make proper alignment for all rows and columns. I used this code to make this table. How to align and add fourth column in Deduction Mode row so that table rows and columns become align. Thank you.
<table width="100%" class="generalTable">
<tr>
<th colspan="3" class="clspopupheading"> Approval
</th>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td style="width: 110px;">
<span class="mendatory">*</span>Employee ID:
</td>
<td colspan="2">
<input type="text" id='txtEmployeeID' runat="server" class="clsTxtDepartmentName" readonly="readonly"/>
<asp:RequiredFieldValidator ID="rfvDepartmentName" runat="server" ValidationGroup="Department"
ErrorMessage="*" Display="Dynamic" ControlToValidate="txtEmployeeID" CssClass="rfvDepartmentName">
</asp:RequiredFieldValidator>
<input type="hidden" id="hfDepartmentId" runat="server" class="hfDepartmentId" />
</td>
</tr>
<tr>
<td >
Approved Amount:
</td>
<td>
<input type="text" id='txtApprovedAmount' runat="server" class="clsTxtDepartmentName"/>
</td>
</tr>
<tr>
<td >
Deduction Mode:
</td>
<td >
<asp:RadioButton ID="fixedamount" GroupName="DeductionMethod" Text="Fixed Amount" Checked="true" runat="server" />
</td>
<td>
<asp:RadioButton ID="percentage" GroupName="DeductionMethod" Text="Percentage" runat="server" />
</td>
</tr>
<tr>
<td >
Deduction Amount/ Percentage:
</td>
<td colspan="3">
<input type="text" id='txtDeductionAmount' runat="server" class="clsTxtDepartmentName"/>
</td>
</tr>
<tr>
<td >
Deduction Mode:
</td>
<td>
<asp:RadioButton ID="rbtnApproval" GroupName="Approval" Text="Approve" Checked="true" runat="server" />
</td>
<td>
<asp:RadioButton ID="rbtnPending" GroupName="Approval" Text="Pending" runat="server" />
</td>
<td>
<asp:RadioButton ID="rbtnReject" GroupName="Approval" Text="Reject" runat="server" />
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="btnSave" Text="Save" runat="server" CssClass="button1 clsBtnSave"
ValidationGroup="Department" OnClick="btnSave_Click" />
<asp:Button ID="btnCancel" Text="Cancel" runat="server"
CssClass="button1 clsCancelButton" onclick="btnCancel_Click"
/>
</td>
</tr>
</table>
You want to throw the multiple choices into a table in one . Also, the colspans weren't quite right. Something like this.
<table width="100%" class="generalTable" border="2">
<tr>
Approval
</th>
</tr>
<tr>
<td colspan="4">
</td>
</tr>
<tr>
<td style="width: 110px;">
<span class="mendatory">*</span>Employee ID:
</td>
<td colspan="3">
<input type="text" id='txtEmployeeID' runat="server" class="clsTxtDepartmentName" readonly="readonly"/>
<asp:RequiredFieldValidator ID="rfvDepartmentName" runat="server" ValidationGroup="Department"
ErrorMessage="*" Display="Dynamic" ControlToValidate="txtEmployeeID" CssClass="rfvDepartmentName">
</asp:RequiredFieldValidator>
<input type="hidden" id="hfDepartmentId" runat="server" class="hfDepartmentId" />
</td>
</tr>
<tr>
<td >
Approved Amount:
</td>
<td colspan = 3>
<input type="text" id='txtApprovedAmount' runat="server" class="clsTxtDepartmentName"/>
</td>
</tr>
<tr>
<td >
Deduction Mode:
</td>
<td colspan = 3>
<table border="1">
<tr>
<td>
<asp:RadioButton ID="fixedamount" GroupName="DeductionMethod" Text="Fixed Amount" Checked="true" runat="server" />
</td>
<td>
<asp:RadioButton ID="percentage" GroupName="DeductionMethod" Text="Percentage" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td >
Deduction Amount/ Percentage:
</td>
<td colspan="3">
<input type="text" id='txtDeductionAmount' runat="server" class="clsTxtDepartmentName"/>
</td>
</tr>
<tr>
<td >
Deduction Mode:
</td>
<td colspan = 3>
<table border="1">
<tr>
<td>
<asp:RadioButton ID="rbtnApproval" GroupName="Approval" Text="Approve" Checked="true" runat="server" />
</td>
<td>
<asp:RadioButton ID="rbtnPending" GroupName="Approval" Text="Pending" runat="server" />
</td>
<td>
<asp:RadioButton ID="rbtnReject" GroupName="Approval" Text="Reject" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="4">
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="btnSave" Text="Save" runat="server" CssClass="button1 clsBtnSave"
ValidationGroup="Department" OnClick="btnSave_Click" />
<asp:Button ID="btnCancel" Text="Cancel" runat="server"
CssClass="button1 clsCancelButton" onclick="btnCancel_Click"
/>
</td>
</tr>
</table>

refresh apart of data list

on datalist command feild i had written code like this
protected void DataListShowImgTxt_ItemCommand(object source, DataListCommandEventArgs e)
{
string id = DataListShowImgTxt.DataKeys[e.Item.ItemIndex].ToString();
//DataListItem tem = DataListShowImgTxt.Items[e.Item.ItemIndex] as DataListItem;
//TextBox txtcmnet = tem.FindControl("txtcomment") as TextBox;
createDt.commonAll("Select UserName from imagedb where imgid='" + id + "'", "searchimage");
string u_name = createDt.GroupDS.Tables["searchimage"].Rows[0]["UserName"].ToString();
if (e.CommandName == "SaveImage")
{
clickpic =Convert.ToInt32(DataListShowImgTxt.DataKeys[e.Item.ItemIndex].ToString());
DataListItem teme = DataListShowImgTxt.Items[e.Item.ItemIndex] as DataListItem;
ImageButton imgbtn = teme.FindControl("Image3") as ImageButton;
imglightbox.ImageUrl = imgbtn.ImageUrl;
ScriptManager.RegisterStartupScript(Page, typeof(Page), "ShowValidation", "javascript:ShowImages();", true);
hovercoment(clickpic);
showhoverlikComment(clickpic);
}
if (e.CommandName == "like")
{
////string id = DataListShowImgTxt.DataKeys[e.Item.ItemIndex].ToString();
createDt.commonAll("insert into likeimgdb(ImgId,UserName,LikeUser,Status,LikeImgDate) values('" + id + "','" + LoginUser + "','" + u_name + "','Like','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"')", "insertimage");
//LinkButton st = tem.FindControl("LinkButton8") as LinkButton;
if (flag == 0)
{
ShowAllFriendsImage1(LoginUser);
}
else if (flag == 1) {
ShowAllFriendsImage(selectUser);
}
}
I want to refresh my webpage only when comandname is like not when command name is saveimage
so please guide me how to refresh it
Actually my design is like this
<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl='<% #Eval("Photo")%>' >
<asp:Image ID="Image2" runat="server" ImageUrl='<% #Eval("Photo")%>' Height="60px"
Width="65px" />
</asp:LinkButton>
</td>
<td style="width: 85%">
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="PrfileFName" CssClass="ppppp">
<asp:Label ID="Label1" runat="server" Text='<% #Eval("FullName")%>'></asp:Label>
</asp:LinkButton>
</td>
</tr>
<tr>
<td style="width: 15%">
</td>
<td style="width: 85%">
<asp:LinkButton ID="LinkButton8" runat="server" CommandName="SaveImage" CssClass="ppppp">
save
<asp:ImageButton ID="Image3" runat="server" ImageUrl='<% #Eval("Image")%>' Height="250px"
Width="320px" />
</asp:LinkButton>
</td>
</tr>
<tr>
<td style="width: 15%">
</td>
<td style="width: 85%">
<asp:LinkButton ID="LinkButton9" runat="server" CommandName="like" ToolTip="Like This"
CssClass="qqq">Like</asp:LinkButton> <asp:Label ID="Label5" runat="server"></asp:Label> <asp:LinkButton
ID="LBComnt" runat="server" ToolTip="Leave a Comment" CommandName="Comment" CssClass="qqq">Comment</asp:LinkButton> <asp:Label
ID="Label4" runat="server" Text='<% #Eval("AddDate")%>'></asp:Label>
</td>
</tr>
<%-- comee--%>
<tr>
<td style="width: 15%">
</td>
<td style="width: 85%">
<asp:DataList ID="DataListLikeComnt" runat="server" CssClass="datalistborder" Width="308px">
<ItemTemplate>
<table width="100%">
<tr>
<td style="width: 15%" align="right">
<asp:ImageButton ID="likeimagebutton" runat="server" ImageUrl="~/ProfileImage/like.jpeg"
Width="30%" Height="30%" />
</td>
<td style="width: 85%">
<asp:LinkButton ID="LblLike" runat="server" Text='<% #Eval("CountLike")%>' CssClass="qqq"></asp:LinkButton>
<asp:Label ID="Label6" runat="server" Text="People Likes" CssClass="www"></asp:Label>
</td>
</tr>
<tr>
<td style="width: 15%" align="right">
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/internet_group_chat.png"
Width="30%" Height="30%" />
</td>
<td style="width: 85%">
<asp:LinkButton ID="Lblcoment" runat="server" Text='<% #Eval("CountComment")%>' CssClass="qqq"></asp:LinkButton>
<asp:Label ID="Label7" runat="server" Text="People Comments" CssClass="www"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td style="width: 15%">
</td>
<td style="width: 85%">
<asp:DataList ID="DataListShowComment" runat="server" CssClass="datalistborder" Width="300px">
<ItemTemplate>
<table width="100%" style="background-color: #e9edf1;">
<tr>
<td style="width: 15%">
<asp:LinkButton ID="LinkButton8" runat="server" CssClass="ppppp" CommandName="CommentProfImage">
<asp:Image ID="Image3" runat="server" ImageUrl='<% #Eval("Photo")%>' Height="30px"
Width="30px" />
</asp:LinkButton>
</td>
<td style="width: 85%">
<table width="100%">
<tr>
<td>
<asp:LinkButton ID="LBProfileImage" runat="server" CssClass="ppppp">
<asp:Label ID="Label1" runat="server" CssClass="www" Text='<% #Eval("FullName")%>'></asp:Label>
</asp:LinkButton> <asp:Label ID="Label8" runat="server" CssClass="www" Text='<% #Eval("Comment")%>'></asp:Label>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
And i want to open image on commandname =SaveImage and update like counter on command name = like
This both is working fine but when i am clicking on like its moving to start location of the page
I want it to just update the count not to move on start
Use it ,
Response.Redirect(Request.RawUrl);
Put this code in your condition ,
if (e.CommandName == "like")
{
////string id = DataListShowImgTxt.DataKeys[e.Item.ItemIndex].ToString();
createDt.commonAll("insert into likeimgdb(ImgId,UserName,LikeUser,Status,LikeImgDate) values('" + id + "','" + LoginUser + "','" + u_name + "','Like','"+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"')", "insertimage");
//LinkButton st = tem.FindControl("LinkButton8") as LinkButton;
if (flag == 0)
{
ShowAllFriendsImage1(LoginUser);
}
else if (flag == 1) {
ShowAllFriendsImage(selectUser);
}
Response.Redirect(Request.RawUrl);
}

IE (html table) issue

What's wrong?
<table id="PollDetails" runat="server" Visible="false">
<tbody>
<tr>
<td align="right">
Poll Question:
</td>
<td align="left">
<asp:TextBox ID="txtQuestion" runat="server" Width="300"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" runat="server" id="lblSelection1" visible="true">
Selection 1:
</td>
<td align="left">
<asp:TextBox ID="txtSelection1" runat="server" Width="300" Visible="false"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" runat="server" id="lblSelection2" visible="true">
Selection 2:
</td>
<td align="left">
<asp:TextBox ID="txtSelection2" runat="server" Width="300" Visible="false"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" runat="server" id="lblSelection3" visible="true">
Selection 3:
</td>
<td align="left">
<asp:TextBox ID="txtSelection3" runat="server" Width="300" Visible="false"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" runat="server" id="lblSelection4" visible="true">
Selection 4:
</td>
<td align="left">
<asp:TextBox ID="txtSelection4" runat="server" Width="300" Visible="false"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" runat="server" id="lblSelection5" visible="true">
Selection 5:
</td>
<td align="left">
<asp:TextBox ID="txtSelection5" runat="server" Width="300" Visible="false"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnSave" runat="server" Text="Save Changes" CausesValidation="False" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="False" />
</td>
</tr>
</tbody>
</table>
Generated Code pasted:
<div>
<table id="ctl00_ContentPage_PollManagement_PollDetails">
<tr>
<td align="right">
Poll Question:
</td>
<td align="left">
<input name="ctl00$ContentPage$PollManagement$txtQuestion" type="text" value="How much time do you spend on a computer daily?" id="ctl00_ContentPage_PollManagement_txtQuestion" style="width:300px;" />
</td>
</tr>
<tr>
<td id="ctl00_ContentPage_PollManagement_lblSelection1" align="right">Selection 1:
</td>
<td align="left">
<input name="ctl00$ContentPage$PollManagement$txtSelection1" type="text" value="Less than 1 Hour" id="ctl00_ContentPage_PollManagement_txtSelection1" style="width:300px;" />
</td>
</tr>
<tr>
<td id="ctl00_ContentPage_PollManagement_lblSelection2" align="right">Selection 2:
</td>
<td align="left">
<input name="ctl00$ContentPage$PollManagement$txtSelection2" type="text" value="Between 1 and 2 Hours " id="ctl00_ContentPage_PollManagement_txtSelection2" style="width:300px;" />
</td>
</tr>
<tr>
<td id="ctl00_ContentPage_PollManagement_lblSelection3" align="right">Selection 3:
</td>
<td align="left">
<input name="ctl00$ContentPage$PollManagement$txtSelection3" type="text" value="Between 2 and 4 Hours " id="ctl00_ContentPage_PollManagement_txtSelection3" style="width:300px;" />
</td>
</tr>
<tr>
<td id="ctl00_ContentPage_PollManagement_lblSelection4" align="right">Selection 4:
</td>
<td align="left">
<input name="ctl00$ContentPage$PollManagement$txtSelection4" type="text" value="Between 4 and 8 Hours " id="ctl00_ContentPage_PollManagement_txtSelection4" style="width:300px;" />
</td>
</tr>
<tr>
<td id="ctl00_ContentPage_PollManagement_lblSelection5" align="right">Selection 5:
</td>
<td align="left">
<input name="ctl00$ContentPage$PollManagement$txtSelection5" type="text" value="Between 8 and 16 Hours" id="ctl00_ContentPage_PollManagement_txtSelection5" style="width:300px;" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" name="ctl00$ContentPage$PollManagement$btnSave" value="Save Changes" id="ctl00_ContentPage_PollManagement_btnSave" />
<input type="submit" name="ctl00$ContentPage$PollManagement$btnCancel" value="Cancel" id="ctl00_ContentPage_PollManagement_btnCancel" />
</td>
</tr>
The table, as posted, shows up properly on the IE7 so it has to be because of surrounding HTML markup in your page.
What DOCTYPE are you using? IE could be interpreting the page differently than Firefox depending on your DOCTYPE.
If you're unfamiliar with DOCTYPES, A List Apart has a good description of them.
Removing all of the [visible ="false"] and completing the closing table table tag delivers the desired output. Start from there.
What is visible and what is not?
Changing all your visibile=false to true it looks fine in ie7.
Try putting a & nbsp; inside the blank TD tag near the bottom.