|
Change the value for Mode Always to Conditional to LoginPanel
thatraja |Chennai|India|
Brainbench certifications Down-votes are like kid's kisses don't reject it Do what you want quickly because the Doomsday on 2012
|
|
|
|
|
Hi,
I am developing a simple web application in ASP.net.
I would like to know in database connection if I face with error how I should show it. do I have to use java script? because unlike desktop application can't use message box.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Data.Sql;
using System.Configuration;
namespace Test.DataAccessLayer
{
public class PersonDataAccess
{
SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["HostelConnectionString"].ConnectionString);
public void insert()
{
try
{
Conn.Open();
}
catch (Exception ex)
{
????????????????????????????????????????????????????????????????????????????
}
}
}
}
|
|
|
|
|
you don't have to use javascript, you can catch the exception and assign ex.message to a label's text.
if you still want to use a message box, you do have to use javascript(you can download a exist class)
|
|
|
|
|
you can show your message, by using Java script alert Message
as
Response.Write("<script>alert('Your Message')</script>");
or you can also use custom error concept to show your message while a error generate
follow link Custom Errors in ASP.NET[^]
|
|
|
|
|
It is not a good practice, to show exception errors in javascript alert.
Better , if you find any exception , show in that page or redirect to some other error page
|
|
|
|
|
Brij wrote: Better , if you find any exception , show in that page or redirect to some other error page
Ya i knew it, that's why i have already describe or refer a link about custom error which works as you say.
|
|
|
|
|
RaviRanjankr wrote: Ya i knew it, that's why i have already describe or refer a link about custom error which works as you say
Obiously, you must be knowing. I just suggested , not to use JS alert.
|
|
|
|
|
Brij wrote: Obiously, you must be knowing. I just suggested , not to use JS alert.
whatever, thanks for your guidance or suggestion.
|
|
|
|
|
first, i'm sorry i'm newbie here and newbie in aspnet. i learn some code from ebook but it's not working. and i'm really sorry too because my english is bad.
when i debug my project its working fine, and i try to add item to my shopping cart its not show any error but the button do not work, its ike the product page only reload. i hope i can find the answer here.
thanks for help.
here the code
CartAccess.cs
using System;
using System.Web;
using System.Data;
using System.Data.Common;
public class CartAccess
{
public CartAccess()
{
}
private static string shoppingCartId
{
get
{
HttpContext context = HttpContext.Current;
string cartId;
{
if (context.Request.Cookies["Delta_CartID"] != null)
{
cartId = context.Request.Cookies["Delta_CartID"].Value;
return cartId;
}
else
{
cartId = Guid.NewGuid().ToString();
HttpCookie cookie = new HttpCookie("Delta_CartID", cartId);
int howManyDays = deltaconfig.CartExpireDays;
DateTime currentDate = DateTime.Now;
TimeSpan timeSpan = new TimeSpan(howManyDays, 0, 0, 0);
DateTime expirationDate = currentDate.Add(timeSpan);
cookie.Expires = expirationDate;
context.Response.Cookies.Add(cookie);
return cartId.ToString();
}
}
}
}
public static bool AddItem(string bookId)
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "AddItem";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@CartID";
param.Value = shoppingCartId;
param.DbType = DbType.String;
param.Size = 36;
comm.Parameters.Add(param);
param = comm.CreateParameter();
param.ParameterName = "@BookID";
param.Value = bookId;
param.DbType = DbType.Int32;
comm.Parameters.Add(param);
try
{
return (DataAccess.ExecuteNonQuery(comm) != -1);
}
catch
{
return false;
}
}
public static bool UpdateItem(string bookId, int cquantity)
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "UpdateItem";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@CartID";
param.Value = shoppingCartId;
param.DbType = DbType.String;
param.Size = 36;
comm.Parameters.Add(param);
param = comm.CreateParameter();
param.ParameterName = "@BookID";
param.Value = bookId;
param.DbType = DbType.Int32;
comm.Parameters.Add(param);
param = comm.CreateParameter();
param.ParameterName = "@CQuantity";
param.Value = cquantity;
param.DbType = DbType.Int32;
comm.Parameters.Add(param);
try
{
return (DataAccess.ExecuteNonQuery(comm) != -1);
}
catch
{
return false;
}
}
public static bool RemoveItem(string bookId)
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "RemoveItem";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@CartID";
param.Value = shoppingCartId;
param.DbType = DbType.String;
param.Size = 36;
comm.Parameters.Add(param);
param = comm.CreateParameter();
param.ParameterName = "@BookID";
param.Value = bookId;
param.DbType = DbType.Int32;
comm.Parameters.Add(param);
try
{
return (DataAccess.ExecuteNonQuery(comm) != -1);
}
catch
{
return false;
}
}
public static DataTable GetItem()
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "GetItem";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@CartID";
param.Value = shoppingCartId;
param.DbType = DbType.String;
param.Size = 36;
comm.Parameters.Add(param);
DataTable table = DataAccess.ExecuteSelectCommand(comm);
return table;
}
public static decimal GetTotalAmount()
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "GetTotalAmount";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@CartID";
param.Value = shoppingCartId;
param.DbType = DbType.String;
param.Size = 36;
comm.Parameters.Add(param);
return Decimal.Parse(DataAccess.ExecuteScalar(comm));
}
public static int CountOldCarts(byte days)
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "CountOldCarts";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@Days";
param.Value = days;
param.DbType = DbType.Byte;
comm.Parameters.Add(param);
try
{
return Byte.Parse(DataAccess.ExecuteScalar(comm));
}
catch
{
return -1;
}
}
public static bool DeleteOldCarts(byte days)
{
DbCommand comm = DataAccess.CreateCommand();
comm.CommandText = "DeleteOldCarts";
DbParameter param = comm.CreateParameter();
param.ParameterName = "@Days";
param.Value = days;
param.DbType = DbType.Byte;
comm.Parameters.Add(param);
try
{
DataAccess.ExecuteNonQuery(comm);
return true;
}
catch
{
return false;
}
}
}
ShoppingCart.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class ShoppingCart : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Populate();
}
}
private void Populate()
{
DataTable dt = CartAccess.GetItem();
if (dt.Rows.Count == 0)
{
gridview.Visible = true;
Updatebtn.Enabled = false;
TotalAmount.Text = String.Format("{0:c}", 0);
}
else
{
gridview.DataSource = dt;
gridview.DataBind();
gridview.Visible = true;
Updatebtn.Enabled = true;
decimal amount = CartAccess.GetTotalAmount();
TotalAmount.Text = String.Format("{0:c}", amount);
}
}
protected void continuebtn_Click(object sender, EventArgs e)
{
Response.Redirect("/");
}
}
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Product : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string bookId = Request.QueryString["BookID"];
BookDetails bd = CatalogAccess.GetBookDetails(bookId);
if (bd.Name != null)
{
Populate(bd);
}
else
{
Server.Transfer("ProductNotfound.aspx");
}
}
private void Populate(BookDetails bd)
{
titleLabel.Text = bd.Name;
descriptionLabel.Text = bd.Description;
stockLabel.Text = Convert.ToString(bd.Quantity);
priceLabel.Text = String.Format("{0:c}", bd.Price);
authorLabel.Text = bd.Author;
productImage.ImageUrl = "BookImage/" + bd.Image;
this.Title = deltaconfig.SiteName + bd.Name;
}
protected void AddToCartButton_Click(object sender, EventArgs e)
{
string bookId = Request.QueryString["BookID"];
CartAccess.AddItem(bookId);
}
}
and thanks again
|
|
|
|
|
Having all of the methods of the cart as static is a bad idea. You are also throwing away the return values. If CartAccess.AddItem returns a bool you should be doing something with it. It could be as simple as setting the text of a label with "added to cart" or "oops something bad happened". I am guessing you would be getting a false and that it has something to do with your database connection. To get detailed info about what went wrong, either remove the try/catch around the DataAccess calls, or in the catch, change it to catch(Exception ex) and set a label with ex.Message.
Your English is not bad at all.
|
|
|
|
|
5 for you because of your etiquette and good manners!!!
|
|
|
|
|
Hi,
Just wondering to know, between ADO.net and Dataset which one is better for working with database.
Could you please give me a link for beginner?
thanks a lot
|
|
|
|
|
|
I have to do an module program which downloads pdf files in the client side. Currently, when users download the file, the url of the downloaded file is viewed by the user.
Modification instructed:
1. In the page where the file download is requested, the url of the downloaded file is viewed in the status bar of that web page. Modification is that the status bar should not display the url of the downloaded file. -- This had been corrected and the code has modified accordingly. It is done correctly only for the first page. Blinks how to process this for the second page..
2. Currently, the call for the download page is given along with the filename of the user request. The filename is passed as the querystring. Modification needed is that the url should get rewritten as "~/download.aspx" instead of "~/download.aspx?<filename>".
I came across using "urlrewriter". But don't know how to implement since i feel little confused with the code examples in net.
I'm placing my code for ur assistance. I'm not using webconfig file also.
old try pdf.aspx
****************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="old try pdf.aspx.cs" Inherits="old_try_pdf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Try PDF - Download</title>
<style>
.link_text
{
font-family:Tahoma;
font-size:10px;
color:#1d5296;
text-decoration:none;
}
.link_text A
{
font-family:Tahoma;
font-size:11px;
color:#1d5296;
text-decoration:underline;
}
.link_text A:hover
{
color:#ff000c;
text-decoration:underline;
}
.link_text A:active
{
color:#ff000c;
text-decoration:underline;
}
.bullets
{
background-image:url(Bullet.gif);
background-position:center;
width:10px;
height:10px;
display:table-cell;
vertical-align:top;
background-repeat:no-repeat;
}
.display_cell
{
border:solid 1px #e6e7e8;
display:table-cell;
width:355px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td class='display_cell'>
<asp:Panel runat=server ID="pnl_pdf"></asp:Panel>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
old try pdf.aspx.cs
*******************
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class old_try_pdf : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Table tb_currency = new Table();
tb_currency.Width = 355;
TableRow tr_currency = new TableRow();
TableCell tc_currency = new TableCell();
Image img_currency = new Image();
HyperLink hlk = new HyperLink();
foreach (string fnames in Directory.GetFiles(@"~\Link 2 Download\pdf"))
{
string fname = null;
tr_currency = new TableRow();
tc_currency = new TableCell();
tc_currency.CssClass = "bullets";
tr_currency.Cells.Add(tc_currency);
tc_currency = new TableCell();
tc_currency.HorizontalAlign = HorizontalAlign.Left;
tc_currency.CssClass = "link_text";
hlk = new HyperLink();
hlk.Target = "_blank";
fname = Path.GetFileNameWithoutExtension(fnames);
hlk.Text = fname;
hlk.Attributes.Add("onMouseOver", "javascript:window.status=''; return true;");
hlk.Attributes.Add("onMouseOut", "javascript:window.status=''; return true;");
hlk.Attributes.Add("onClick", "javascript:window.status=''; return true;");
hlk.NavigateUrl = "~/Old download_pdf.aspx?fn=" + fname;
tc_currency.Controls.Add(hlk);
tr_currency.Cells.Add(tc_currency);
tb_currency.Rows.Add(tr_currency);
}
pnl_pdf.Controls.Clear();
pnl_pdf.Controls.Add(tb_currency);
}
}
Old download_pdf.aspx
*********************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Old download_pdf.aspx.cs" Inherits="Old_download_pdf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Old download_pdf.aspx.cs
************************
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.IO;
public partial class Old_download_pdf : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strMessage = "Wait.... File is downloading....";
this.RegisterStartupScript("SetStatusText", "<script>window.status='" + strMessage + "';</script>");
if (Request.QueryString.Count > 0)
{
string fn = Request.QueryString.Get(0).ToString();
string spath = @"~\pdf\" + fn + ".pdf";
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=my_test.pdf");
Response.TransmitFile(spath);
Response.End();
}
}
}
Even using register startup variable, in Old_download_pdf.aspx, it is showing the downloaded file url path in status bar of the page Old_download_pdf.aspx. Also we have to rewrite the url from "~/Old download_pdf.aspx?fn=<filename>" as simply "~/Old download_pdf.aspx".
When i tried using a hidden variable, i failed in setting the value of the hidden field during the click event of the dynamically creating hyperlink control.
How to complete this? Thanks in advance.
Regards,
M.Sworna Vidhya
|
|
|
|
|
Hi All,
I just come across a pretty weird behaviour on my VS 2005 and Ajax, basically i am having a master page and a content page. This is the front end html code for the master page:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="WebApplication3.MasterPage" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test Page</title>
<link href="Stylesheet1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<%--<cc:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc:ToolkitScriptManager> --%>
<cc:Accordion ID="Accordion1" runat="server" FadeTransitions="true" SelectedIndex="0"
HeaderCssClass="accordionHeader" ContentCssClass="accordionContent">
<Panes>
<cc:AccordionPane ID="AccordionPane1" runat="server">
<Header>Test Pane 1</Header>
<Content>Test pane 1</Content>
</cc:AccordionPane>
<cc:AccordionPane ID="AccordionPane2" runat="server">
<Header>Test Pane 2</Header>
<Content>Test pane 2</Content>
</cc:AccordionPane>
<cc:AccordionPane ID="AccordionPane3" runat="server">
<Header>Test Pane 3</Header>
<Content>Test pane 3</Content>
</cc:AccordionPane>
</Panes>
</cc:Accordion>
</div>
</form>
</body>
</html>
and this is the front end html code for the content page:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication3.Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
test
</asp:Content>
but when i try to run it, it always gives me this bloody error:Server Error in '/' Application.
--------------------------------------------------------------------------------
The control with ID 'Accordion1_AccordionExtender' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The control with ID 'Accordion1_AccordionExtender' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
I even dont have this control 'Accordion1_AccordionExtender' on my page, so i dont know what is complaining for.
But when i put the same code in vs 2008, and i use
<cc:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc:ToolkitScriptManager> instead of
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> it just worked like a charm, i was searching on the internet, quite a few ppl got the same issue, but no one has a resonable answer about it. My AjaxControlToolkit.dll was released at 12/05/2010 and AJAXExtensionsToolbox.dll was released at 13/12/2006. Can someone in here plz shed me a light what could be the issue?Many thanks.
|
|
|
|
|
Hi guys,
Im working on asp.net1.1 web application on C#. actually i have a page in which the user fills up certain details and also have an option to upload a file which is mandatory. Now at the database along with the details entered by the user the file location path also gets saved in the database say for example D:\webapp\Hello\Modules\Agreement\01-11-2010 08-43-50AMimage.gif -- dis is what gets stored in the DB. Now after the user has clicked the submit button the data is inserted and i also have a datagrid in the same page on which the data stored in database gets populated, currently the path of the file is displayed on the datagrid as mentioned above. but what my requirement is i want the path to be displayed as a hyperlink so dat on clicking the link the file gets downloaded.. trhe code is as follows
the following code is on page display.aspx.cs
private void BindAgreement()
{
string Module = Request.QueryString["servId"];
DataSet dReasons = DataAccess.ExecuteStoredProcedure(Session["MosaicConn"].ToString(),"asp_app_get_mainagreement "+Module);
if(dReasons.Tables.Count > 0)
{
if(dReasons.Tables[0].Rows.Count > 0)
{
DataTable dtDisplay = new DataTable();
dtDisplay.Columns.Add(new DataColumn("row_id",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("module_id",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("total_value",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("amc_start_dt",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("license_amt",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("implement_amt",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("number_of_licenses",typeof(string)));
dtDisplay.Columns.Add(new DataColumn("agree_file_name",typeof(string)));
for(int i = 0; i < dReasons.Tables[0].Rows.Count; i++)
{
DataRow drDisplay;
drDisplay = dtDisplay.NewRow();
drDisplay[0] = dReasons.Tables[0].Rows[i].ItemArray[0];
drDisplay[1] = dReasons.Tables[0].Rows[i].ItemArray[1];
drDisplay[2] = dReasons.Tables[0].Rows[i].ItemArray[2];
drDisplay[3] = dReasons.Tables[0].Rows[i].ItemArray[3];
drDisplay[4] = dReasons.Tables[0].Rows[i].ItemArray[4];
drDisplay[5] = dReasons.Tables[0].Rows[i].ItemArray[5];
drDisplay[6] = dReasons.Tables[0].Rows[i].ItemArray[6];
drDisplay[7] = dReasons.Tables[0].Rows[i].ItemArray[7];
dtDisplay.Rows.Add(drDisplay);
}
lblMessage.Visible = false;
rptUsers.DataSource = dtDisplay;
rptUsers.DataBind();
}
the following code is the code for the datagrid on display.aspx page
<table style="BORDER-COLLAPSE: collapse" borderColor="#006699" width="100%" border="1">
<tr>
<td bgColor="background" colSpan="6"><FONT face="Arial" color="#ffffff" size="2"><STRONG> Available
Agreements</STRONG></FONT></td>
</tr>
<TR bgColor="background">
<td style="WIDTH: 38px"><FONT face="Verdana" color="#ffffff" size="1"><b> Total Value</b></FONT></td>
<td style="WIDTH: 66px"><FONT face="Verdana" color="#ffffff" size="1"><b> AMC Start
Date</b></FONT></td>
<td style="WIDTH: 50px"><FONT face="Verdana" color="#ffffff" size="1"><b> License
Amount</b></FONT></td>
<td style="WIDTH: 95px"><FONT face="Verdana" color="#ffffff" size="1"><b> Implementation
Amount</b></FONT></td>
<td><FONT face="Verdana" color="#ffffff" size="1"><b> Number of licenses</b></FONT></td>
<td><FONT face="Verdana" color="#ffffff" size="1"><b> File Name</b></FONT></td>
</TR>
<asp:repeater id="rptUsers" runat="server">
<ItemTemplate>
<TR bgColor="#dcd1ff">
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"total_value")%> </FONT><input runat=server type="hidden" id="row_id" name="row_id" value='<%# DataBinder.Eval(Container.DataItem,"row_id")%>'></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"amc_start_dt")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"license_amt")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"implement_amt")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"number_of_licenses")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"agree_file_name")%> </FONT></td>
</TR>
</ItemTemplate>
<AlternatingItemTemplate>
<TR bgColor="#d7dcff">
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"total_value")%> </FONT><input runat=server type="hidden" id="Hidden1" name="row_id" value='<%# DataBinder.Eval(Container.DataItem,"row_id")%>'></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"amc_start_dt")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"license_amt")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"implement_amt")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"number_of_licenses")%> </FONT></td>
<td><FONT face="Verdana" size="1"> <%# DataBinder.Eval(Container.DataItem,"agree_file_name")%> </FONT></td>
</TR>
</AlternatingItemTemplate>
</asp:repeater></table>
<br>
</td></TD></tr>
</table>
Thanx in advance,
Tash
|
|
|
|
|
Add a hyperlink rather than a label. What problems are you encountering? What don't you understand?
Also, you should not be using the FONT element. Use CSS.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi thanks for your reply.
Actually i can display the path of the file in my page. since im using a repeater over here i wanna show the path of the file as a hyper link and when user clicks on the path the file should get downloaded.. im struggling at this point.. Any help is appreciated..
Thanx in advance,
Tash
|
|
|
|
|
Hello,
i have multiple files on server. I want to Copy all files on Client Machine at once time.
Now i am just using this code
Response.Write("<script type=\"text/javascript\">window.open('download.aspx?f=" + path + "');</script>");
Its Save the file one by one on client machine and ask every time for save.
But i want to save all files at once save click, ya copy all files in Client Machine at once
Regards
Raushan Kumar
|
|
|
|
|
hello all..
I want to ask for help..
about making simple chatting.. with filter word..
any suggest or turtorial maybe?
just simple chatting like facebook, maybe desktop not online..
thx b4..
|
|
|
|
|
if you go to BCC news website or any other website you'll see the usrl is referring to a file like this:
http://www.bbc.co.uk/news/world-middle-east-11661496
not to a database like this:
http://www.bbc.co.uk/news.aspx?id=9999999
so what's the best way to save news website? how do they do it? i don't think it's just physical files because maintaining it would be very very difficult..
can anyone explain to me please....
|
|
|
|
|
jrahma wrote: http://www.bbc.co.uk/news/world-middle-east-11661496
The above url that you are talking about, It is not the linked to the direct page. They must have used some routing mechanism or URL rewriting kind of thing. So user clicks the news link it is redirected to the appropriate page wit the help of mechanism implemented.
jrahma wrote: so what's the best way to save news website? how do they do it? i don't think it's just physical files because maintaining it would be very very difficult..
I didn't get your question.
Do you want save the links of the news. So for a user point of view, both the links are same, whether the routed url or querystring one.
|
|
|
|
|
I have a timer which displays the current time within an asp:UpdatePanel This part is working fine..
I have another asp:UpdatePanel on the same page with two TextBoxs for login purpose.
The problem when the timer is running and I try to put the cursor in one of the two boxes in the UpdatePagel of the loging area it just stays there for seconds and then lose the focus! why is that?
these are the panels:
<dxt:ASPxTimer ID="timerClock" runat="server" Interval="1000" OnTick="timerClock_Tick" />
<asp:UpdatePanel runat="server" UpdateMode="Always">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="timerClock" />
</Triggers>
<ContentTemplate>
<asp:Table runat="server" Width="120" BorderWidth="0" CellPadding="0" CellSpacing="0">
<asp:TableRow>
<asp:TableCell HorizontalAlign="Center" VerticalAlign="Middle"><dxe:ASPxImage ID="imageFlag" runat="server" ImageUrl="~/images/flags/ar-BH.gif" /></asp:TableCell>
<asp:TableCell HorizontalAlign="Center" VerticalAlign="Middle" Width="100%"><dxe:ASPxLabel ID="lblCurrentTime" runat="server" Font-Bold="true" Text="Loading.." /></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Table ID="Table1" runat="server" CellPadding="2" CellSpacing="2">
<asp:TableRow><asp:TableCell>Email Address:</asp:TableCell></asp:TableRow>
<asp:TableRow><asp:TableCell><dxe:ASPxTextBox ID="txtLoginEmail" runat="server" Width="160px" /></asp:TableCell></asp:TableRow>
<asp:TableRow><asp:TableCell>Password:</asp:TableCell></asp:TableRow>
<asp:TableRow><asp:TableCell><dxe:ASPxTextBox ID="txtLoginPassword" runat="server" Width="160px" /></asp:TableCell></asp:TableRow>
<asp:TableRow><asp:TableCell HorizontalAlign="Center"><asp:Button ID="btnLogin" runat="server" Text="Login" Width="100px" /></asp:TableCell></asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
|
|
|
|
|
What is the easiest way to achieve that?
Do I have to create an API for my website?
Any references please send them.
Thanks
|
|
|
|
|
Hello
what does this error mean?
"500-inernal server error .
There is a problem with the resource you are looking for, and it cannot be displayed."
This project has been written with visual studio .net 2010 and the database is ms sql server 2008.
Every few times I am faced with this error.
Can anyone help me to solve this error ?
Thanks
Davood
D.riazi
|
|
|
|