|
There is no way to validate an actual email. You can validate its format using a Regex and you can validate the email server, but there is no way to actually know an email address exists, is valid, and can receive your message.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hello friends
my asp application facilitates downloading files from one server to many clients computers. but when i tested download speed from a client computer, i realized that it is too slow. But when i use "remote desktop" (i mean connecting to server via remote desktop) downloading is becoming so fast. I am using this code:
FileInfo fi = new FileInfo(FileURL);
HttpContext.Current.Response.ContentType = "application/vnd.xls";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename =" + fi.Name);
HttpContext.Current.Response.TransmitFile(FileURL);
HttpContext.Current.Response.End();
So i want to ask that what kind of a connection does remote desktop use. And how can i make my downloads faster. thank you
|
|
|
|
|
You mean, the download speed of your server was fast (you logged in with remote desktop and downloaded a file to your server), while the download of a client (file from your server) was slow?
The reason for that could be a upstream/downstream speed difference of the internet connection of your server.
While the first szenario is a downstream szenario, the latter one is upstream (from the server point of view).
In general, you have to differ between upstream/downstream speed and client/server connection speed. Your clients
will usually have a slower internet connection.
|
|
|
|
|
Where do you store the file when you use remote desktop? If it's in your normal documents or downloads directory, that file never leaves your server, because these directories are also on the server computer. Nothing travels over the wire.
Apart from that, remote desktop uses this internally: http://msdn.microsoft.com/en-us/library/aa383546(v=VS.85).aspx[^]
Citrix uses something similar, but the interface is a bit more complicated (and you need to get a developer license to get at it).
|
|
|
|
|
I am using a radGrid which automatically sorts the bound columns; however, the griv also contains textbox columns which get out of sync once the bound columns are sorted. Can anyone help me with this? code below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.WebControls;
using System.Collections;
using System.Data;
public partial class _Default : System.Web.UI.Page
{
protected RadGrid grid;
protected static ArrayList list = new ArrayList();
override protected void OnInit(EventArgs e)
{
DefineGridStructure();
base.OnInit(e);
}
private void DefineGridStructure()
{
this.grid = new RadGrid();
this.grid.AutoGenerateColumns = false;
this.grid.NeedDataSource += new GridNeedDataSourceEventHandler(OnNeedDataSource);
// this.grid.Page = this;
this.grid.AllowPaging = true;
this.grid.AllowSorting = true;
this.grid.PageSize = 4;
this.grid.Width = 650;
//other columns definitions ----------------------------
string templateColumnName = "TextBox Column 1";
GridTemplateColumn templateColumn = new GridTemplateColumn();
templateColumn.ItemTemplate = new MyTemplate(templateColumnName);
templateColumn.HeaderText = templateColumnName;
templateColumn.HeaderStyle.Width = 300;
string templateColumnName3 = "TextBox Column 2";
GridTemplateColumn templateColumn3 = new GridTemplateColumn();
templateColumn3.ItemTemplate = new MyTemplate3(templateColumnName3);
templateColumn3.HeaderText = templateColumnName3;
templateColumn3.HeaderStyle.Width = 300;
GridBoundColumn boundColumn1 = new GridBoundColumn();
boundColumn1.DataField = "B";
boundColumn1.UniqueName = "ConactName2";
boundColumn1.HeaderText = "Bound Column";
boundColumn1.HeaderStyle.Width = 300;
string templateColumnName2 = "Dropdown List Column";
GridTemplateColumn templateColumn2 = new GridTemplateColumn();
templateColumn2.ItemTemplate = new MyTemplate2(templateColumnName2);
templateColumn2.HeaderText = templateColumnName2;
templateColumn2.HeaderStyle.Width = 300;
this.grid.MasterTableView.Columns.Add(templateColumn);
this.grid.MasterTableView.Columns.Add(templateColumn2);
this.grid.MasterTableView.Columns.Add(boundColumn1);
this.grid.MasterTableView.Columns.Add(templateColumn3);
grid.AllowPaging = true;
grid.PageSize = 5;
grid.ClientSettings.Scrolling.AllowScroll = true;
grid.ClientSettings.Scrolling.ScrollHeight = 230;
grid.ClientSettings.Scrolling.ScrollWidth = 1200;
this.PlaceHolder1.Controls.Add(grid);
}
protected void grid_NeedDataSource(object source, Telerik.WebControls.GridNeedDataSourceEventArgs e)
{
this.grid.DataSource = list;
}
protected void Page_Load(object sender, EventArgs e)
{
ArrayList alist = new ArrayList();
list = new ArrayList();
alist.Add("1");
alist.Add("2");
list.Add( new TestListItem( "ItemA 0", "ItemB a", "ItemC a", alist ));
list.Add( new TestListItem( "ItemA 1", "ItemB b", "ItemC b", alist ));
list.Add( new TestListItem( "ItemA 2", "ItemB c", "ItemC c", alist ));
list.Add( new TestListItem( "ItemA 3", "ItemB d", "ItemC d", alist ));
list.Add( new TestListItem( "ItemA 4", "ItemB e", "ItemC e", alist ));
list.Add( new TestListItem( "ItemA 5", "ItemB f", "ItemC f", alist ));
}
private class MyTemplate : ITemplate
{
protected TextBox textBox1;
static int i;
private string colname;
public MyTemplate(string cName)
{
colname = cName;
}
public void InstantiateIn(System.Web.UI.Control container)
{
textBox1 = new TextBox();
textBox1.ID = "templateColumnTextBox";
textBox1.DataBinding += new EventHandler (this.BindTextBox1);
container.Controls.Add(textBox1);
}
void BindTextBox1(object sender, EventArgs e)
{
if (i >= list.Count)
i = 0;
if ( i < list.Count)
{
((TextBox)sender).Text = ((TestListItem)list[i]).A;
i++;
}
}
}
private class MyTemplate2 : ITemplate
{
protected DropDownList ddlValue;
private string colname;
public MyTemplate2(string cName)
{
colname = cName;
}
public void InstantiateIn(System.Web.UI.Control container)
{
ddlValue = new DropDownList();
ddlValue.ID = "templateColumnDropDownList";
ddlValue.CssClass = "DropDownList";
ddlValue.DataBinding += new EventHandler (this.BindDropDownList);
container.Controls.Add(ddlValue);
}
void BindDropDownList(object sender, EventArgs e)
{
((DropDownList)sender).DataSource = ((TestListItem)list[0]).AList;
}
}
private class MyTemplate3 : ITemplate
{
protected TextBox textBox3;
static int i;
private string colname;
public MyTemplate3(string cName)
{
colname = cName;
}
public void InstantiateIn(System.Web.UI.Control container)
{
textBox3 = new TextBox();
textBox3.ID = "templateColumnTextBox3";
textBox3.DataBinding += new EventHandler (this.BindTextBox3);
container.Controls.Add(textBox3);
}
void BindTextBox3(object sender, EventArgs e)
{
if (i >= list.Count)
i = 0;
if ( i < list.Count)
{
((TextBox)sender).Text = ((TestListItem)list[i]).C;
i++;
}
}
}
void OnNeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
grid.DataSource = list;
}
public class TestListItem
{
private string _a;
private string _b;
private string _c;
ArrayList _aList;
public TestListItem( string a, string b, string c, ArrayList aList )
{
this._a = a;
this._b = b;
this._c = c;
this._aList = aList;
}
public string A
{
get
{
return this._a;
}
set
{
this._a = value;
}
}
public string B
{
get
{
return this._b;
}
set
{
this._b = value;
}
}
public string C
{
get
{
return this._c;
}
set
{
this._c = value;
}
}
public ArrayList AList
{
get
{
return this._aList;
}
set
{
this._aList = value;
}
}
}
}
|
|
|
|
|
The last post I made like this one got
voted down but I'm doing it again anyways ....
http://www.telerik.com/support.aspx[^]
Part of the HIGH cost of these controls
is the very excellent support provided.
|
|
|
|
|
When I go to their support site I am unable to access my post. If possible could someone look at the code, it is very simple, and see if they have any ideas? If this is not a proper post for this site please let me know and i will not post anything else about this issue.
Thanks,
Steve Holdorf
|
|
|
|
|
Don't take it personal, personally I can't afford
radControls but from your post I can see their
value.
Your posts here are not only welcomed but encouraged.
|
|
|
|
|
A lot of hard work but I got it. Thanks anyway.
Thanks,
Steve Holdorf
|
|
|
|
|
Hi,
i have an object with a method which returns a string
public class Object
{
public Object(){}
public string methodName()
{
string result = ...some calculations...
return result;
}
}
im using this object as datasource for GridView1
GridView1.DataSource=Object1;
now i want to bind this method to GridView1 column
<%# Bind("methodName()")%>
but it fails..
when i bind a property its works ok, but i need bind a result returd from method.
Is is possible or there is any work around?
thanks
|
|
|
|
|
I haven't tried this, but as you said property is working fine, then have a property like this
public string GetValue
{
get
{
return methodName();
}
}
And use this property.
|
|
|
|
|
yes, but its gonna run this method every time i create an object.
i want only run this method when i need..
i gonna read your article,
thanks for answer
|
|
|
|
|
marijus5 wrote: but its gonna run this method every time i create an object.
Have some logic when you wanna create it else you can also store it somewhere say viewstate etc...
marijus5 wrote: i gonna read your article
Pls share your feedback
|
|
|
|
|
hi guys im actually working on C# web application on VS2003(Version 1.1) in my web page i have a date picker now the date gets stored in a string this way:
string FrmDt=DtP_frm.Text.Replace("/","");
so the string stored here is in format like this --> 12042010, with this string i retrieve my records from database with search query. but in the database i have to pass this string as --> 20100412 which is yyyymmdd format... How do i achieve this...
Any advise is appreciated...
Thanx in advance,
Tash
|
|
|
|
|
<<tash18>> wrote: string FrmDt=DtP_frm.Text.Replace("/","");
In here, before replacing the '/', convert into the yyyymmdd format that you need and then replace the '/', pass on as search parameter to Database.
Like:
String tempDate = Convert.ToDateTime(DtP_frm.Text).ToString("yyyy/MM/dd");
Now use this tempDate for your manipulation of removing the '/' and passing to DB.
|
|
|
|
|
Hi,
I have basically the following structure set up :
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" ... >
:
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" ... >
</asp:ObjectDataSource>
<asp:ImageButton ID="NewInsertButton" runat="server" OnClick="NewInsertButton_Click" />
<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource2" ... >
<InsertItemTemplate>
:
<asp:FileUpload ID="FileUpload1" runat="server" />
:
<asp:ImageButton ID="ImageButton1" runat="server" CommandName="Insert" />
</InsertItemTemplate>
:
</asp:FormView>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" ... >
</asp:ObjectDataSource>
</ContentTemplate>
</asp:UpdatePanel>
I am aware that a FileUpload requires a full page postback. I read the article
http://www.4guysfromrolla.com/articles/090209-1.aspx[^]
I tried to install a PostBackTrigger programmatically to get a full postback only on the ImageButton1 control. All other postbacks must be partial. (GridView sorting, paging, ...)
In code behind I do :
protected void NewInsertButton_Click(object sender, ImageClickEventArgs e)
{
FormView1.ChangeMode(FormViewMode.Insert);
FormView1.DataBind();
ImageButton InsertButton = FormView1.FindControl("ImageButton1") as ImageButton;
if (InsertButton == null)
throw new NullReferenceException("ImageButton1");
ScriptManager Manager = ScriptManager.GetCurrent(Page);
if (Manager == null)
throw new NullReferenceException("ScriptManager");
Manager.RegisterPostBackControl(InsertButton);
:
}
The above code does not seem to install a full postback only for the ImageButton1, so the file upload fails. How can I make this work ?
|
|
|
|
|
Because I can't work with your code as prsented
I will give this very simple example of an udatepanel
containing a button for update and another button for
postback ...
Hope it helps .
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e){
if (Page.IsPostBack) { myLabel.Text = "posted back"; }
ScriptManager current = ScriptManager.GetCurrent(Page);
if (current != null)
{ current.RegisterPostBackControl(Button2); }
}
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Clear();
String[] ds = {"hi RED","sup RED"};
String[] ds1 = { "hi BLUE", "sup BLUE" };
if (DropDownList2.SelectedValue == "RED")
{ DropDownList1.DataSource = ds;
DropDownList1.DataBind(); }
if (DropDownList2.SelectedValue == "BLUE")
{ DropDownList1.DataSource = ds1;
DropDownList1.DataBind();
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1 { width:300px; height:100px; } </style>
</head>
<body>
<form id="form1" runat="server">
<div style="padding-top: 10px">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>RED</asp:ListItem>
<asp:ListItem>BLUE</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="UpDate" />
<asp:Button ID="Button2" runat="server" Text="PostBack" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:Label runat="server" ID="myLabel"></asp:Label>
</div>
</form>
</body>
</html>
modified on Sunday, April 18, 2010 10:49 AM
|
|
|
|
|
Thx for the reply. I appreciate your effort. I tested your code, and yes it works,
but in my case I use form views which creates their embedded controls dynamically.
I found numerous examples on the net, demonstrating how it has to be done, but I found
none which resembles my senario.
For one reason or another my code does not function, and I would like to know why.
|
|
|
|
|
If you could present some very brief but complete
code that illistates your problem I could easily
correct it, but it must be brief and complete.
|
|
|
|
|
Hello,
I have been creating a simple gridview in an asp.net application connected to sql server. Everthing works fine on the local development site, when I deploy I get the following error.
Invalid column name 'ClientID'.
Invalid column name 'ContractorID'.
Invalid column name 'ProjectType'.
Invalid column name 'HideProject'.
Invalid column name 'StartOnSite'.
Invalid column name 'Completion'.
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.Data.SqlClient.SqlException: Invalid column name 'ClientID'.
Invalid column name 'ContractorID'.
Invalid column name 'ProjectType'.
Invalid column name 'HideProject'.
Invalid column name 'StartOnSite'.
Invalid column name 'Completion'.
The gridview has been created using visual studio 2008, without modification, and points to a view based on 3 tables. I have re-created both the gridview and tables several times. The view was scripted from the local sql server on the remote server, using Create View with SET QUOTED_IDENTIFIER ON and also turned off. I have removed all parameters, so theres nothing that could trip up the query. The query runs fine on the remote server when I look at it with Management Server. I have also tried changing all the fields on the gridview to template fields, so I can see the bindings and check for upper and lower cases, and everything is fine. I have checked through lots of articles and this is usually due to missing columns on the view or table, or upper and lower cases in the mark up; but they are all fine and work in the development environment?
This is driving me mad. Since the view runs on the server without problems, it must be the asp.net gridview thats tripping out. But I can't see it.
Here is the gridview markup.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" <br />
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" <br />
CellPadding="3" CssClass="menutxt" DataKeyNames="ProjectID" <br />
DataSourceID="ProjectListing" GridLines="Vertical"><br />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" /><br />
<Columns><br />
<asp:BoundField DataField="ProjectID" HeaderText="ProjectID" ReadOnly="True" <br />
SortExpression="ProjectID" /><br />
<asp:BoundField DataField="ClientID" HeaderText="ClientID" <br />
SortExpression="ClientID" /><br />
<asp:BoundField DataField="ProjectName" HeaderText="ProjectName" <br />
SortExpression="ProjectName" /><br />
<asp:BoundField DataField="ContractorID" HeaderText="ContractorID" <br />
SortExpression="ContractorID" /><br />
<asp:BoundField DataField="ProjectType" HeaderText="ProjectType" <br />
SortExpression="ProjectType" /><br />
<asp:BoundField DataField="Description" HeaderText="Description" <br />
SortExpression="Description" /><br />
<asp:CheckBoxField DataField="HideProject" HeaderText="HideProject" <br />
SortExpression="HideProject" /><br />
<asp:BoundField DataField="StartOnSite" HeaderText="StartOnSite" <br />
SortExpression="StartOnSite" /><br />
<asp:BoundField DataField="Completion" HeaderText="Completion" <br />
SortExpression="Completion" /><br />
<asp:BoundField DataField="CompanyName" HeaderText="CompanyName" <br />
SortExpression="CompanyName" /><br />
</Columns><br />
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" /><br />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /><br />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /><br />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /><br />
<AlternatingRowStyle BackColor="#DCDCDC" /><br />
</asp:GridView><br />
<asp:SqlDataSource ID="ProjectListing" runat="server" <br />
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>" <br />
SelectCommand="SELECT [ProjectID], [ClientID], [ProjectName], [ContractorID], [ProjectType], [Description], [HideProject], [StartOnSite], [Completion], [CompanyName] FROM [About_VProjectList]"><br />
</asp:SqlDataSource>
What school boy error am I making that I just can't see?
|
|
|
|
|
Have you checked the conneciton string? Is it pointed to the correct database?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark,
Thanks for the reply, I have now sorted the problem. I stopped, grabbed a beer and started again from scratch. The problem was the order of the tables as I brought them into the view. The main table with Project information was not selected first. This obvuiosly effects the order of the inner joins. It seems the remote database is more sensitive than the development database. It worked locally, but crashed on the server. Opening both Visual Studio and Management Studio, I created the views together, selecting the main table first, then the forein key tables, making sure to select the columns in the same order. This appears to have resolved the error. I am now going to carry on with the beer. Regards, Tony
|
|
|
|
|
|
Hi.
Please help me with this as i am also getting the same error.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="Prod_code" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Prod_code" HeaderText="Prod_code" ReadOnly="True"
SortExpression="Prod_code" />
<asp:BoundField DataField="Prod_cate_id" HeaderText="Prod_cate_id"
SortExpression="Prod_cate_id" />
<asp:BoundField DataField="Prod_name" HeaderText="Prod_name"
SortExpression="Prod_name" />
<asp:BoundField DataField="Prod_desc" HeaderText="Prod_desc"
SortExpression="Prod_desc" />
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image ID="image1" runat="server" ImageUrl='<%#"Handler.ashx?Prod_code="+Eval("Prod_code") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:centurydbConnectionString2 %>"
SelectCommand="SELECT [Prod_code], [Prod_cate_id], [Prod_name], [Prod_desc], [Prod_image], [Price], [Status] FROM [Prod_detail1]">
</asp:SqlDataSource>
Please help me with this error................................
|
|
|
|
|
how can we check whether a list item in radio button list is selected or not,
without using for each loop or javascript
Known is a drop, unknown is an ocean
-- Modified Sunday, April 18, 2010 6:24 AM
|
|
|
|
|