Click here to Skip to main content
15,922,325 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Form Submit not functioning Pin
Abhijit Jana4-Sep-08 3:43
professionalAbhijit Jana4-Sep-08 3:43 
GeneralRe: Form Submit not functioning Pin
omlac4-Sep-08 3:56
omlac4-Sep-08 3:56 
GeneralRe: Form Submit not functioning Pin
omlac4-Sep-08 4:05
omlac4-Sep-08 4:05 
GeneralRe: Form Submit not functioning Pin
omlac4-Sep-08 4:23
omlac4-Sep-08 4:23 
QuestionUse of arabic language in sql2005 Pin
samerh4-Sep-08 2:40
samerh4-Sep-08 2:40 
AnswerRe: Use of arabic language in sql2005 Pin
WillemM4-Sep-08 8:02
WillemM4-Sep-08 8:02 
Questioncustom repeator with previous next button added at footer Pin
_tasleem4-Sep-08 2:26
_tasleem4-Sep-08 2:26 
AnswerRe: custom repeator with previous next button added at footer Pin
Learning IT4-Sep-08 19:46
Learning IT4-Sep-08 19:46 
instead of footer you can place 2 link buttons bellow repeater

the code goes like this

<br />
<br />
  <footertemplate><br />
	   <br />
   </footertemplate><br />
    <br />
    <br />
 <br />
  <tr><br />
    <td><br />
     <input type="hidden" id="PageSize" value="5" runat="server" /><br />
    </td><br />
     <td>  <br />
    <input type="hidden" id="CurrentPage" value="1" runat="server" /><br />
   </td><br />
     <td><br />
    <input type="hidden" id="TotalSize" runat="server" /><br />
    </td> <br />
 </tr><br />
  <tr><br />
     <td align="center" style="font-weight: bold; border-top-width: thick; border-left-width: thick; border-bottom-width: thick; border-right-width: thick;" colspan="3"><br />
      <asp:linkbutton id="Prev" text="<< Previous" visible="false" forecolor="blue" onclick="Page_Repeater" runat="server" xmlns:asp="#unknown" /> <br />
      <asp:linkbutton id="Next" text="Next >>" visible="false" forecolor="blue" onclick="Page_Repeater" runat="server" xmlns:asp="#unknown" /><br />
    </td><br />
  </tr><br />
<br />



public void Repeaterfill()
  {
       SqlDataAdapter da = new SqlDataAdapter("select a.Complaint_id,a.Emp_id,a.Decription,"
          + " substring(Convert(varchar,a.Problem_date),0,12) as Problem_date,substring(Convert(varchar,b.Resolved_Date),0,12) as Resolved_Date"
          + " from Hr_complaint_detail a,hr_complaint_status b where a.sys_complaint_id=b.Complaint_id and b.Resolved_or_not=1 and a.Emp_id="+empid, con);
      DataSet ds = new DataSet();



      //Get the start Record Count
      //Remember database count is zero based so first decrease the value of
      //the current page
      int startRecord = (int.Parse(CurrentPage.Value) - 1) *
         int.Parse(PageSize.Value);
      //Fetch only the necessary records.
      da.Fill(ds, startRecord, int.Parse(PageSize.Value), "hr_complaint_status");

      //DataBind the Repeater
      Rep_comp_solved.DataSource = ds.Tables["hr_complaint_status"].DefaultView;
      Rep_comp_solved.DataBind();

      if (ds.Tables["hr_complaint_status"].Rows.Count <= 0)
      {
          Rep_comp_solved.Visible = false;
          s = "No solved Complaints are there";
          CreateMessageAlert(this, s);
          Prev.Visible = false;
          Next.Visible = false;
      }
      else
      {
          Prev.Visible = true;
          Next.Visible = true;
      }

      //Second Part
      //Create a new Command to select the total number of records
      SqlCommand Cmd = new SqlCommand("select count(*) from Hr_complaint_detail a,hr_complaint_status b "
                  + " where a.sys_complaint_id=b.Complaint_id and b.Resolved_or_not=1 and a.Emp_id="+empid, con);
      con.Open();
      //retrieve the value
      TotalSize.Value = Cmd.ExecuteScalar().ToString();
      con.Close();
      BuildPagers();
  }

public void Page_Repeater(object sender, EventArgs e)
  {
      //Check for Button clicked
      if (((LinkButton)sender).ID == "Prev")
      {
          //Check if we are on any page greater than 0
          if ((int.Parse(CurrentPage.Value) - 1) >= 0)
          {
              //Decrease the CurrentPage Value
              CurrentPage.Value = (int.Parse(CurrentPage.Value) - 1).ToString();
          }
      }
      else if (((LinkButton)sender).ID == "Next")
      {
          //Check if we can display the next page.
          if ((int.Parse(CurrentPage.Value) * int.Parse(PageSize.Value))< int.Parse(TotalSize.Value))
          {
              //Increment the CurrentPage value
              CurrentPage.Value = (int.Parse(CurrentPage.Value) + 1).ToString();
          }
      }
      //Rebuild the Grid
      Repeaterfill();
  }
  public void BuildPagers()
  {
      //Check if its possible to have the previous page
      if ((int.Parse(CurrentPage.Value) - 1) <= 0)
      {
          Prev.Enabled = false;
      }
      else
      {
          Prev.Enabled = true;
      }
      //Check if its possible to have the next page
      if ((int.Parse(CurrentPage.Value) * int.Parse(PageSize.Value)) >= int.Parse(TotalSize.Value))
      {
          Next.Enabled = false;
      }
      else
      {
          Next.Enabled = true;
      }
  }


Maniiiiiiiiiiiiiii

GeneralRe: custom repeator with previous next button added at footer Pin
_tasleem4-Sep-08 23:28
_tasleem4-Sep-08 23:28 
QuestionAdding values to a datagrid (.net 2005) Pin
Karan_TN4-Sep-08 2:02
Karan_TN4-Sep-08 2:02 
AnswerRe: Adding values to a datagrid (.net 2005) Pin
ToddHileHoffer4-Sep-08 2:17
ToddHileHoffer4-Sep-08 2:17 
GeneralRe: Adding values to a datagrid (.net 2005) Pin
Karan_TN4-Sep-08 20:07
Karan_TN4-Sep-08 20:07 
GeneralRe: Adding values to a datagrid (.net 2005) Pin
ToddHileHoffer5-Sep-08 2:05
ToddHileHoffer5-Sep-08 2:05 
GeneralRe: Adding values to a datagrid (.net 2005) Pin
Karan_TN5-Sep-08 20:58
Karan_TN5-Sep-08 20:58 
QuestionConfiguring ASP.NET to work with Analysis Services 2005 - help much appreciated! Pin
nassymafi4-Sep-08 1:51
nassymafi4-Sep-08 1:51 
AnswerRe: Configuring ASP.NET to work with Analysis Services 2005 - help much appreciated! Pin
scottgp4-Sep-08 3:19
professionalscottgp4-Sep-08 3:19 
Questiongridview validation Pin
nithydurai4-Sep-08 1:38
nithydurai4-Sep-08 1:38 
AnswerRe: gridview validation Pin
Learning IT4-Sep-08 19:49
Learning IT4-Sep-08 19:49 
Questionhow to reduce page size Pin
omlac4-Sep-08 1:23
omlac4-Sep-08 1:23 
AnswerRe: how to reduce page size Pin
ToddHileHoffer4-Sep-08 2:22
ToddHileHoffer4-Sep-08 2:22 
QuestionUnicode text Pin
Archana New to Dotnet4-Sep-08 1:14
Archana New to Dotnet4-Sep-08 1:14 
AnswerRe: Unicode text Pin
eyeseetee4-Sep-08 1:22
eyeseetee4-Sep-08 1:22 
GeneralRe: Unicode text Pin
Archana New to Dotnet4-Sep-08 2:05
Archana New to Dotnet4-Sep-08 2:05 
Questionhello everybody Pin
harish.k124-Sep-08 1:06
harish.k124-Sep-08 1:06 
AnswerRe: hello everybody Pin
Mogaambo4-Sep-08 1:08
Mogaambo4-Sep-08 1:08 

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.