Click here to Skip to main content
15,887,485 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiongetting the full file path from a FileUpload control in Mozilla Pin
ashutosh kumar jha8-Feb-10 8:33
ashutosh kumar jha8-Feb-10 8:33 
AnswerRe: getting the full file path from a FileUpload control in Mozilla Pin
Abhishek Sur8-Feb-10 9:27
professionalAbhishek Sur8-Feb-10 9:27 
GeneralRe: getting the full file path from a FileUpload control in Mozilla Pin
ashutosh kumar jha8-Feb-10 20:57
ashutosh kumar jha8-Feb-10 20:57 
GeneralRe: getting the full file path from a FileUpload control in Mozilla Pin
Abhishek Sur9-Feb-10 10:00
professionalAbhishek Sur9-Feb-10 10:00 
Questiongridview pagination Pin
FEMDEV8-Feb-10 6:28
FEMDEV8-Feb-10 6:28 
AnswerRe: gridview pagination Pin
Vimalsoft(Pty) Ltd8-Feb-10 19:48
professionalVimalsoft(Pty) Ltd8-Feb-10 19:48 
AnswerRe: gridview pagination Pin
Gaurav Dudeja India8-Feb-10 19:54
Gaurav Dudeja India8-Feb-10 19:54 
GeneralRe: gridview pagination Pin
FEMDEV11-Feb-10 3:33
FEMDEV11-Feb-10 3:33 
protected override void InitializePager(GridViewRow row, int columnSpan, PagedDataSource pagedDataSource)
{
try
{

if (PagerType == ThisPagerType.Regular)
{

try
{
if (CustomPaging)
{
pagedDataSource.AllowCustomPaging = true;
pagedDataSource.VirtualCount = VirtualItemCount;
pagedDataSource.CurrentPageIndex = CurrentPageIndex;
}
base.InitializePager(row, columnSpan, pagedDataSource);

}
catch (Exception ex)
{

throw ex;
}
}
else
{
pagedDataSource.AllowCustomPaging = true;
pagedDataSource.VirtualCount = VirtualItemCount;
pagedDataSource.CurrentPageIndex = CurrentPageIndex;

PlaceHolder plc = new PlaceHolder();

TableCell cell_0 = new TableCell();
TableCell cell_1;
{
cell_1 = new TableCell();

LinkButton prev = new LinkButton();
prev.Text = "<< Previous ";
prev.CommandArgument = string.Format("{0}", (pagedDataSource.CurrentPageIndex - 1));
prev.Visible = (pagedDataSource.CurrentPageIndex > 0);
prev.CssClass = "pagnPrev";
prev.Click += new EventHandler(navigate_Click);
cell_1.Controls.Add(prev);

for (int i = 0; i < pagedDataSource.PageCount; i++)
{
LinkButton numb = new LinkButton();
numb.ID = i.ToString();
numb.Text = Convert.ToString(i + 1);
numb.CommandArgument = string.Format("{0}", Convert.ToString(i));
if (i == pagedDataSource.CurrentPageIndex)
{
numb.Enabled = false;
numb.CssClass = "pagnCur";
}
else
{
numb.Enabled = true;
numb.CssClass = "pagnLink";
}
numb.Click += new EventHandler(navigate_Click);
cell_1.Controls.Add(numb);
if (i < pagedDataSource.PageCount)
{
Literal ltl = new Literal();
ltl.Text = "&nbsp;";
cell_1.Controls.Add(ltl);
}
}

LinkButton next = new LinkButton();
next.Text = "Next >>";
next.CommandArgument = string.Format("{0}", (pagedDataSource.CurrentPageIndex + 1));
next.Visible = (pagedDataSource.CurrentPageIndex < (pagedDataSource.PageCount - 1));
next.CssClass = "pagnNext";
next.Click += new EventHandler(navigate_Click);
cell_1.Controls.Add(next);

}

// create a Table that will replace entirely our GridView's Pager section
Table tbl = new Table();
tbl.BorderWidth = 0;
tbl.Width = Unit.Percentage(100);
tbl.Rows.Add(new TableRow());

tbl.Rows[0].Cells.Add(cell_1);
tbl.Rows[0].Cells[0].HorizontalAlign = HorizontalAlign.Right;
row.Controls.AddAt(0, new TableCell());
row.Cells[0].ColumnSpan = Columns.Count;
row.Cells[0].Controls.AddAt(0, tbl);

if ((FooterText != null) && (FooterURL != null))
{

Literal ltlLink = new Literal();
ltlLink.Text = @"<a href="""+ FooterURL +@""" title="""+ FooterText+ @""" target=""_self"">" + FooterText + "</a>";
this.FooterRow.Cells[0].Controls.Add(ltlLink);
}
else if (FooterText != null)
this.FooterRow.Cells[0].Text = FooterText;
}
}


public virtual void LoadGrid(MailSearch mailSearch, userAccount ,int pageCount)
{


try
{

mailSearch.PageSize = 20;
mailSearch.SelectedPage = pageCount;

MailResults mailResults = new MailResults();

//sent messages
if (ViewState["ReceivedFlag"] == null)
{
mailSearch.FromPartyId = userAccount.PartyId;
mailResults = userAccount .MailSearch(mailSearch, Helper.GetLoggedInIdentity());
}
//received messages
else if (ViewState["ReceivedFlag"].ToString() == "true")
{
mailResults = userAccount.MailSearchByReceivedMessages(mailSearch, userAccount.PartyId, Helper.GetLoggedInIdentity());
}
//sent messages
else if (ViewState["ReceivedFlag"].ToString() == "false")
{
mailSearch.FromPartyId = userAccount.PartyId;
mailResults = userAccount.MailSearch(mailSearch, Helper.GetLoggedInIdentity());
}
if (mailResults.MailCollection.Count == 0)
{ lblXYZ.Text = "Currently, You don't have ....."; }
else
{
int size;
if ((mailResults.RowCount) < (pageCount * 20))
{ size = (int)mailResults.RowCount; }
else { size = (pageCount * 20); }
lblXYZ.Text = "Mail ( " + ((pageCount * 20) - 19) + "-" + size + " of " + mailResults.RowCount + ")";
}

DataTable dt = new DataTable();
dt.Columns.Add("MailID");
dt.Columns.Add("FromUserName");
dt.Columns.Add("Subject");
dt.Columns.Add("CreatedDate");
dt.Columns.Add("LastViewedDate");
dt.Columns.Add("dteCreatedDate");
dt.Columns.Add("dteLastViewedDate");

DataRow drow;
foreach (Mail mail in mailResults.MailCollection)
{
drow = dt.NewRow();
drow["MailID"] = mail.MailId;
drow["FromUserName"] = mail.FromUserName;
drow["Subject"] = mail.Subject;
drow["CreatedDate"] = mail.CreatedDate.ToString("dd/MM/yyyy HH:mm");
if (!String.IsNullOrEmpty(mail.LastViewedDate.ToString()))
drow["LastViewedDate"] = mail.LastViewedDate.Value.ToString("dd/MM/yyyy HH:mm");
else
drow["LastViewedDate"] = mail.LastViewedDate;
drow["dteCreatedDate"] = mail.CreatedDate;
drow["dteLastViewedDate"] = mail.LastViewedDate;

dt.Rows.Add(drow);
}

this.gvMail.PageSize = mailSearch.PageSize.Value;
this.gvMail.VirtualItemCount = mailResults.RowCount.Value;
this.gvMail.CurrentPageIndex = pageCount - 1;



gvMail.DataSource = dt;
gvMail.DataBind();
}
catch (Exception ex)
{
xyz
throw;
}

}
Questionbody Onload Looping.. Pin
Hema Bairavan8-Feb-10 2:30
Hema Bairavan8-Feb-10 2:30 
AnswerRe: body Onload Looping.. Pin
Not Active8-Feb-10 2:50
mentorNot Active8-Feb-10 2:50 
QuestionCustom textbox control problem in Firefox and Chrome [modified] Pin
Danpeking8-Feb-10 1:51
Danpeking8-Feb-10 1:51 
QuestionI wanna make a webpage to find ID or password. Pin
lsh486love8-Feb-10 1:46
lsh486love8-Feb-10 1:46 
AnswerRe: I wanna make a webpage to find ID or password. Pin
Not Active8-Feb-10 2:07
mentorNot Active8-Feb-10 2:07 
AnswerRe: I wanna make a webpage to find ID or password. Pin
sashidhar8-Feb-10 3:22
sashidhar8-Feb-10 3:22 
Questionrestric multiple download concept implemented by rapidshare and hotfile Pin
Tridip Bhattacharjee8-Feb-10 0:31
professionalTridip Bhattacharjee8-Feb-10 0:31 
AnswerRe: restric multiple download concept implemented by rapidshare and hotfile Pin
sashidhar8-Feb-10 0:54
sashidhar8-Feb-10 0:54 
QuestionBlog size Pin
Satish328-Feb-10 0:18
Satish328-Feb-10 0:18 
AnswerRe: Blog size Pin
Abhishek Sur8-Feb-10 9:32
professionalAbhishek Sur8-Feb-10 9:32 
Questionresume large file download? Pin
Tridip Bhattacharjee7-Feb-10 23:53
professionalTridip Bhattacharjee7-Feb-10 23:53 
AnswerRe: resume large file download? Pin
Rhys Jacob7-Feb-10 23:59
Rhys Jacob7-Feb-10 23:59 
QuestionFile download by ICallback Pin
Tridip Bhattacharjee7-Feb-10 23:52
professionalTridip Bhattacharjee7-Feb-10 23:52 
Questionpartial postback and IFrame Pin
Tridip Bhattacharjee7-Feb-10 23:51
professionalTridip Bhattacharjee7-Feb-10 23:51 
AnswerRe: partial postback and IFrame Pin
tronix018-Feb-10 21:07
tronix018-Feb-10 21:07 
QuestionHelp with multiple dropdownlists and updatepanels Pin
callousfantom7-Feb-10 23:18
callousfantom7-Feb-10 23:18 
Questionweb service Pin
mylogics7-Feb-10 22:15
professionalmylogics7-Feb-10 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.