|
First and foremost, edit your post and remove the connection details. Its not so good to post your SQL server's sa password on forums even if it is CodeProject.
First step to solving this would be to step through your code and identify if the dt that your are persisting in the session has any values. Debug the application, put a break point on the statement Session["CheckedRecords"] = dt; . Check if it has any values before going into the session.
If it has values then on the 2nd page check what you are getting out of the session. Again put a break point on the line DataTable dt = (DataTable)Session["CheckedRecords"]; and check the values in dt.
Some suggestions [read free advice ]
1. Data table is an reference type. You need not return it from AddNewRow and RemoveRow methods. The dt in the calling function and the dt local to AddNewRow and RemoveRow methods point to the same datatable in the heap. Doing this way would just increase the over head on the GC and reduce maintainability of your code.
2. In the AddNewRow method, rather than doing "dt.Rows.Count - 1 " every time, do it once and store it as rowNum and use it subsequently. This reduces the number of execution cycles.
3. Format your code. Proper indentation improves readability.
HTH!
|
|
|
|
|
check the reply for your post on:
http://opexsolution.com/forum/viewtopic.php?f=15&t=27
|
|
|
|
|
Hi Guys
Is it possible to format specific words using CSS?
I'm wanting to highlight key words within some pages of code samples, but don't fancy wrapping all the keywords in tags...
Cheers,
oooo, the Jedi's will feel this one....
|
|
|
|
|
The current level of CSS does not offer this much
desired feature.It can be acomplished with a simple
regular expression either in javascript on the client
or the language of your choice on the server.The
result would be to progromaticaly add fancy wrapping
in tags to all the keywords .
|
|
|
|
|
OK cool. I'll have a crack at that method then. A little c# behind the scenes could go a long way...
Thank you.
oooo, the Jedi's will feel this one....
|
|
|
|
|
hello,
I want to make invitation facility in my website.j
so please...
can anyone tell me how to import contacts from gmail, yahoo, etc in asp.net.
it's very urgent.
Thanks in advance.
|
|
|
|
|
|
Each of them have their own services to import contacts,please see on google.com
|
|
|
|
|
You replied to me. . You should reply to proper message !!
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
ohh sorry Abhijit....
|
|
|
|
|
Hii
I have some problem .can anybody help me out.
Question:How to search aspx page names in entire asp.net website
Regards
Surya
|
|
|
|
|
Didn't get your problem. What do you mean by search aspx page name ? Do you want to search with in your web site ?
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Press Control,Shift and F button u will get a search window. Type usr page name u ll get all related pages
|
|
|
|
|
I have used urlrewriting.net for url rewriting in my application.I have buttonfield in gridview as
<asp:ButtonField HeaderText="Buy" ButtonType="Image" ImageUrl="~/images/addtocart.png"
CommandName="addtocart" />
Th image of add to cart is not coming.On running the application and looking to property of image it shows the url of page as
http://localhost:3811/Sections/flat-panel-displays-222
Instead of image url where it is stored i.e. http://localhost:3811/images/addtocart.png
|
|
|
|
|
Hi All,
I've got text going into a DB which may contain links, or naked URL's.
I do cleanup on the way in to avoid XSS attacks, but on the way out, I want any URL's to display as links.
So, I've got a couple possibilities. If the link is already within an anchor tag, then I want it to display properly as a link.
If the link is a plain URL within the text, I need to add an anchor tag.
I'm currently using:
Regex.Replace(dr.Item(1), "(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])", Function(match As Match) String.Format("<a href=""{0}"">{0}</a>", match.ToString()), RegexOptions.IgnoreCase)
This will add an anchor tag surrounding a naked URL, but what I need is for it not to act on a URL that is already within an anchor tags.
Help please?
|
|
|
|
|
Save yourself the trouble and clean the anchor tags from the string prior to saving to the database. As a rule of thumb you should never store formatted items in the database, let the formatting happen at the presentation layer. That way when the business rules change, or the data needs to be used in different context, it's easier to adapt.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ok, I've narrowed down the question.
I have a Regex that matches a naked URL ( http://www.whatever.com/whatever.... )
What I need to know is what to add to the beginning and end of that Regex so that it does not match if there is a double quote right before or after the URL.
It's the "NOT QUOTES" thing that I'm not getting.
|
|
|
|
|
hi friends,
Can you give me a reference how to validate email address with asp.net? I want to check
that email address exists or not.Some one suggested to use windows dos command nslookup to find email server, but if I use a shared hosting that might not be a good idea.
So can you guys give me an idea or reference how to make things work??
Thanks
|
|
|
|
|
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
|
|
|
|