CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 7/3/2007 6:09:37 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 23 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
ravensensei
Asp.Net User
changing url params on submit7/3/2007 6:09:37 PM

0/0

I have three dropdowns that I would like to use to change the params I am using in the url.  I have gridviews on several pages that run on these values, but they never update when I change the dropdowns in the master page.

Ideally, I would like to write something that changes the url params everytime I hit the submit button.

Should I just use a page redirect whenever I hit the submit button?

 

augustwind
Asp.Net User
Re: changing url params on submit7/3/2007 6:28:00 PM

0/0

in the Master page scenario, every page is different, but you use the Master page for the constant look and feel.

If your ddls and the submit button are on the Master, and you want something to change in the page that's open, you'll need a much more robust code.

Please explain more thoroughly:
"...change the params I am using in the url"

Are the entries in the DDL urls?


David Wier
MVP/MCP/ASPInsider
ASPNet101.com - where to look first!
iWrite Pro - doc/rtft to HTML/One Click PDF & much more
ravensensei
Asp.Net User
Re: changing url params on submit7/3/2007 9:39:46 PM

0/0

I have a master page with three dropdowns that allow people to choose the building, the year, and the quarter.  That sets the url params that run the gridviews in all of the pages.

The problem is, when I am on a page and use one of the links to go to another page, it doesn't change the url params.  If I am on page 1 and I hit bldg1, qtr 1 and year 2007 and then I hit the link for page2, the url params are still in place, which is good.  The problem is, if I change the dropdowns, the url params stay the same.

 

I had thought I would just reset them in the onclick event of the button, but I'm having problems setting things once it comes to the page.


 from the masterpage codebehind:

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;

public partial class ScoreCardEntry : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string fac = Request.QueryString["fac"];
        string year = Request.QueryString["year"];
        string qtr = Request.QueryString["qtr"];
       
        udsp_SCCust1.FilterExpression = "measureshortname='CUST1'";
         try
            {
                if (year != null)
                {
                    ddlYear.SelectedValue = year;
                }
                else
                {
                    //l_Error.Visible = true;
                    l_Error.Text = "Year is not set.";
                }
                if (qtr != null)
                {
                    ddlQuarter.SelectedValue = qtr;
                }
                else
                {
                    //l_Error.Visible = true;
                    l_Error.Text = "Quarter is not set.";
                }
                if (fac != null)
                {
                    ddlFacility.SelectedValue = fac;
                    ddlFacility.DataBind();
                    //l_Error.Visible = false;
                }
                else
                {
                    //l_Error.Visible = true;
                    l_Error.Text = "Facility is not set.";
                }
              
            }
            catch (Exception )
            {
                 l_Error.Text = "Check your dropdown values.";
            }
       

        //if they've picked all three, show the content pane
            if (!ddlFacility.SelectedValue.Equals(0) && ddlYear.SelectedIndex != 0 && ddlQuarter.SelectedIndex != 0)
            {
                ContentPlaceHolder1.Visible = true;
                //l_Error.Visible = false;
            }
            else
            {
                ContentPlaceHolder1.Visible = false;
                //l_Error.Visible = true;
            }

         }

    protected void submit_Click(object sender, EventArgs e)
    {
        if (!ddlFacility.SelectedValue.Equals(0) && ddlYear.SelectedIndex != 0 && ddlQuarter.SelectedIndex != 0)
        {
            ContentPlaceHolder1.Visible = true;
            l_Error.Visible=false;
        }
        else
        {
            ContentPlaceHolder1.Visible = false;
        }

        Response.Write(Request.ServerVariables["SCRIPT_NAME"]+"?fac="+ddlFacility.SelectedValue+"&qtr="+ddlQuarter.SelectedValue+"&year="+ddlYear.SelectedValue);
       
    }

   
}

from one of the aspx pages:

<%@ Page Language="C#" MasterPageFile="ScoreCardEntry.master" AutoEventWireup="true"
    CodeFile="fin.aspx.cs" Inherits="fin" %>

<asp:Content ID="finMeasure" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table border="0" cellpadding="5" style="width: 755px">
        <tr>
            <td colspan="8" style="border-right: black thin solid; border-top: black thin solid;
                margin: 1px; border-left: black thin solid; border-bottom: black thin solid;"
                valign="top" bordercolor="#000000">
                <table border="0" style="width: 650px">
                    <tr>
                        <td colspan="2" valign="top">
                            <table style="width: 187px">
                                <tr>
                                    <td style="height: 23px" width="100%">
                                        <asp:Label ID="label_FIN1" runat="server" Font-Bold="True" Text="FIN1" CssClass="header"></asp:Label></td>
                                    <td style="height: 23px" width="100%">
                                    </td>
                                    <td style="height: 23px" valign="top" width="100%">
                                        <asp:Label ID="l_fin1Desc" runat="server" Text="Label" CssClass="header" Width="250px"></asp:Label></td>
                                </tr>
                            </table>
                        </td>
                        <td align="left" style="width: 349px;" valign="bottom">
                            </td>
                    </tr>
                    <tr>
                        <td colspan="2" rowspan="1" style="height: 139px" valign="top">
                            <asp:GridView ID="gv_fin1" runat="server" AutoGenerateColumns="False" DataSourceID="udsp_SCFin1"
                                CellPadding="4" Font-Names="Arial" Font-Size="12px" OnRowDataBound="gridSetup1"
                                ForeColor="#333333" GridLines="None">
                                <Columns>
                                    <asp:BoundField DataField="month" HeaderText="Month" SortExpression="month" />
                                    <asp:TemplateField HeaderText="Measure1" SortExpression="Measure1">
                                        <ItemTemplate>
                                            <!--%# GetMeasure1Total(decimal.Parse(Eval("Measure1").ToString(),)).ToString("0.00")%-->
                                            <%# GetMeasure1Total(Eval("Measure1").ToString()) %>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <%# Get1Total().ToString("0.00")%>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Measure2" SortExpression="Measure2">
                                        <ItemTemplate>
                                            <%# GetMeasure2Total(decimal.Parse(Eval("Measure2").ToString())).ToString("0.00") %>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <%# Get2Total().ToString("0.00")%>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Score" HeaderText="Score" ReadOnly="True" SortExpression="Score" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Image ID="fin1Ball" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="Green" ForeColor="White" Font-Bold="True" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="Green" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#7C6F57" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                        </td>
                        <td colspan="1" rowspan="1" style="height: 139px; width: 349px;" valign="top">
                            <asp:TextBox ID="tbCommFin1" runat="server" Height="123px" TextMode="MultiLine"
                                Width="337px">enter your new comments here</asp:TextBox><br />
                            <asp:Button ID="bSaveFin1" runat="server" OnClick="bSaveFin1_Click" Text="Save" />
                            <asp:HyperLink ID="hl_fin1" runat="server" Target="_blank" Width="290px"
                                Font-Names="Arial" Font-Size="11px" NavigateUrl="~/ScoreCardEntry/comments.aspx">Previous Comments</asp:HyperLink></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="8" style="border-right: black thin solid; border-top: black thin solid;
                margin: 1px; border-left: black thin solid; border-bottom: black thin solid;"
                valign="top" bordercolor="#000000">
                <table border="0" style="width: 650px">
                    <tr>
                        <td colspan="2" valign="top" style="height: 38px">
                            <table style="width: 187px">
                                <tr>
                                    <td style="height: 23px" width="100%">
                                        <asp:Label ID="label_FIN2" runat="server" Font-Bold="True" Text="FIN2" CssClass="header"></asp:Label></td>
                                    <td style="height: 23px" width="100%">
                                    </td>
                                    <td style="height: 23px" valign="top" width="100%">
                                        <asp:Label ID="l_fin2Desc" runat="server" Text="Label" CssClass="header" Width="250px"></asp:Label></td>
                                </tr>
                            </table>
                        </td>
                        <td align="left" style="width: 349px; height: 38px;" valign="bottom">
                            </td>
                    </tr>
                    <tr>
                        <td colspan="2" rowspan="1" style="height: 159px" valign="top">
                            <asp:GridView ID="gv_fin2" runat="server" AutoGenerateColumns="False" DataSourceID="udsp_SCFin2"
                                CellPadding="4" Font-Names="Arial" Font-Size="12px" OnRowDataBound="gridSetup2"
                                ForeColor="#333333" GridLines="None">
                                <Columns>
                                    <asp:BoundField DataField="month" HeaderText="Month" SortExpression="month" />
                                    <asp:TemplateField HeaderText="Measure1" SortExpression="Measure1">
                                        <ItemTemplate>
                                            <%# GetMeasure1Total(Eval("Measure1").ToString()).ToString("0.00")%>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <%# Get1Total().ToString("0.00")%>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Measure2" SortExpression="Measure2">
                                        <ItemTemplate>
                                            <%# GetMeasure2Total(decimal.Parse(Eval("Measure2").ToString())).ToString("0.00") %>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <%# Get2Total().ToString("0.00")%>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Score" HeaderText="Score" ReadOnly="True" SortExpression="Score" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Image ID="fin2Ball" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="Green" ForeColor="White" Font-Bold="True" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="Green" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#7C6F57" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                            &nbsp;
                        </td>
                        <td colspan="1" rowspan="1" style="height: 159px; width: 349px;" valign="top">
                            <asp:TextBox ID="tbCommFin2" runat="server" Height="123px" TextMode="MultiLine"
                                Width="337px">enter your new comments here</asp:TextBox><br />
                            <asp:Button ID="bSaveFin2" runat="server" OnClick="bSaveFin2_Click" Text="Save" />
                            <asp:HyperLink ID="hl_fin2" runat="server" Target="_blank" Width="290px"
                                Font-Names="Arial" Font-Size="11px" NavigateUrl="~/ScoreCardEntry/comments.aspx">Previous Comments</asp:HyperLink></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="8" style="border-right: black thin solid; border-top: black thin solid;
                margin: 1px; border-left: black thin solid; border-bottom: black thin solid;"
                valign="top" bordercolor="#000000">
                <table border="0" style="width: 650px">
                    <tr>
                        <td colspan="2" valign="top" style="height: 38px">
                            <table style="width: 187px">
                                <tr>
                                    <td style="height: 23px" width="100%">
                                        <asp:Label ID="label_FIN3" runat="server" Font-Bold="True" Text="FIN3" CssClass="header"></asp:Label></td>
                                    <td style="height: 23px" width="100%">
                                    </td>
                                    <td style="height: 23px" valign="top" width="100%">
                                        <asp:Label ID="l_fin3Desc" runat="server" Text="Label" CssClass="header" Width="250px"></asp:Label></td>
                                </tr>
                            </table>
                        </td>
                        <td align="left" style="width: 349px; height: 38px;" valign="bottom">
                            </td>
                    </tr>
                    <tr>
                        <td colspan="2" rowspan="1" style="height: 159px" valign="top">
                            <asp:GridView ID="gv_fin3" runat="server" AutoGenerateColumns="False" DataSourceID="udsp_SCFin3"
                                CellPadding="4" Font-Names="Arial" Font-Size="12px" OnRowDataBound="gridSetup3"
                                ForeColor="#333333" GridLines="None">
                                <Columns>
                                    <asp:BoundField DataField="month" HeaderText="Month" SortExpression="month" />
                                    <asp:TemplateField HeaderText="Measure1" SortExpression="Measure1">
                                        <ItemTemplate>
                                            <%# GetMeasure1Total(Eval("Measure1").ToString()).ToString("0.00")%>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <%# Get1Total().ToString("0.00")%>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Measure2" SortExpression="Measure2">
                                        <ItemTemplate>
                                            <%# GetMeasure2Total(decimal.Parse(Eval("Measure2").ToString())).ToString("0.00") %>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <%# Get2Total().ToString("0.00")%>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Score" HeaderText="Score" ReadOnly="True" SortExpression="Score" />
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Image ID="fin3Ball" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="Green" ForeColor="White" Font-Bold="True" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                <HeaderStyle BackColor="Green" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#7C6F57" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                            &nbsp;
                        </td>
                        <td colspan="1" rowspan="1" style="height: 159px; width: 349px;" valign="top">
                            <asp:TextBox ID="tbCommFin3" runat="server" Height="123px" TextMode="MultiLine"
                                Width="337px">enter your new comments here</asp:TextBox><br />
                            <asp:Button ID="bSaveFin3" runat="server" OnClick="bSaveFin3_Click" Text="Save" />
                            <asp:HyperLink ID="hl_fin3" runat="server" Target="_blank" Width="290px"
                                Font-Names="Arial" Font-Size="11px" NavigateUrl="~/ScoreCardEntry/comments.aspx">Previous Comments</asp:HyperLink></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="udsp_SCFin1" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>" SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:QueryStringParameter Name="qtr" QueryStringField="qtr" Type="Int32" />
            <asp:QueryStringParameter Name="year" QueryStringField="year" Type="Int32" />
            <asp:QueryStringParameter Name="entID" QueryStringField="fac" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
        <asp:SqlDataSource ID="udsp_SCFin2" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>"
        SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:QueryStringParameter Name="qtr" QueryStringField="qtr" Type="Int32" />
            <asp:QueryStringParameter Name="year" QueryStringField="year" Type="Int32" />
            <asp:QueryStringParameter Name="entID" QueryStringField="fac" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="udsp_SCFin3" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>"
        SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:QueryStringParameter Name="qtr" QueryStringField="qtr" Type="Int32" />
            <asp:QueryStringParameter Name="year" QueryStringField="year" Type="Int32" />
            <asp:QueryStringParameter Name="entID" QueryStringField="fac" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="udsp_SCFin4" runat="server" ConnectionString="<%$ ConnectionStrings:Cypress_APPConnectionString %>"
        SelectCommand="udsp_ScorecardQuarterly" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlQuarter" Name="qtr" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:ControlParameter ControlID="ddlYear" Name="year" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:ControlParameter ControlID="ddlFacility" Name="entID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>   
</asp:Content>

from the code behind

using System;
using System.Data;
using System.Data.SqlClient;
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;

public partial class fin : System.Web.UI.Page
{
    string email = "";
    SqlConnection conn;
    SqlCommand cmd;
    string source = "this works";
    string fin1Meas1 = "";
    string fin1Meas2 = "";
    string fin2Meas1 = "";
    string fin2Meas2 = "";
    string fin3Meas1 = "";
    string fin3Meas2 = "";

       

    protected void Page_Load(object sender, EventArgs e)
    {
        hl_fin1.NavigateUrl = "~/ScoreCardEntry/comments.aspx?meas=FIN1&fac=" + Request.QueryString["fac"];
        hl_fin2.NavigateUrl = "~/ScoreCardEntry/comments.aspx?meas=FIN2&fac=" + Request.QueryString["fac"];
        hl_fin3.NavigateUrl = "~/ScoreCardEntry/comments.aspx?meas=FIN3&fac=" + Request.QueryString["fac"];


        udsp_SCFin1.FilterExpression = "measureshortname='FIN1'";
        udsp_SCFin2.FilterExpression = "measureshortname='FIN2'";
        udsp_SCFin3.FilterExpression = "measureshortname='FIN3'";
        udsp_SCFin4.FilterExpression = "measureshortname='FIN4'";

        email = Request.QueryString["email"];
       
        //automatically update status for the contract so they can see where they are from the contracttablepage
        string select = "SELECT Description, shortname, measure1, measure2 FROM Measure where shortname like 'FIN%'";
       
        conn = new SqlConnection(source);
        conn.Open();
        cmd = new SqlCommand(select, conn);
        SqlDataReader dbreader = cmd.ExecuteReader();

        while (dbreader.Read())
        {
            if(dbreader["shortname"].ToString() == "FIN1")
            {
                l_fin1Desc.Text = dbreader.GetValue(0).ToString();
                fin1Meas1 = dbreader.GetValue(2).ToString();
                fin1Meas2 = dbreader.GetValue(3).ToString();
            }
            else if (dbreader["shortname"].ToString() == "FIN2")
            {
                l_fin2Desc.Text = dbreader.GetValue(0).ToString();
                fin2Meas1 = dbreader.GetValue(2).ToString();
                fin2Meas2 = dbreader.GetValue(3).ToString();

            }
            else if (dbreader["shortname"].ToString() == "FIN3")
            {
                l_fin3Desc.Text = dbreader.GetValue(0).ToString();
                fin3Meas1 = dbreader.GetValue(2).ToString();
                fin3Meas2 = dbreader.GetValue(3).ToString();
            }
            else if (dbreader["shortname"].ToString() == "FIN4")
            {
            }
           

        }

        conn.Close();

    }

    public void gridSetup1(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Cells[1].Text = fin1Meas1;
            e.Row.Cells[2].Text = fin1Meas2;
        }
       
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Image myImage;
            myImage = (Image)e.Row.FindControl("fin1Ball");
            if (e.Row.Cells[3].Text.Trim() == "3.00")
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.LightGreen;
                myImage.ImageUrl = "media/images/greenball.gif";
               
            }
            else if (e.Row.Cells[3].Text.Trim() == "0.00")
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.Red;
                myImage.ImageUrl = "media/images/redball.gif";
            }
            else
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.Yellow;
                myImage.ImageUrl = "media/images/yellowball.gif";
            }
        }
    }
    public void gridSetup2(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Cells[1].Text = fin1Meas1;
            e.Row.Cells[2].Text = fin1Meas2;
        }

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Image myImage;
            myImage = (Image)e.Row.FindControl("fin2Ball");
            if (e.Row.Cells[3].Text.Trim() == "3.00")
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.LightGreen;
                myImage.ImageUrl = "media/images/greenball.gif";

            }
            else if (e.Row.Cells[3].Text.Trim() == "0.00")
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.Red;
                myImage.ImageUrl = "media/images/redball.gif";
            }
            else
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.Yellow;
                myImage.ImageUrl = "media/images/yellowball.gif";
            }
        }
    }
    public void gridSetup3(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            e.Row.Cells[1].Text = fin1Meas1;
            e.Row.Cells[2].Text = fin1Meas2;
        }

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Image myImage;
            myImage = (Image)e.Row.FindControl("fin3Ball");
            if (e.Row.Cells[3].Text.Trim() == "3.00")
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.LightGreen;
                myImage.ImageUrl = "media/images/greenball.gif";

            }
            else if (e.Row.Cells[3].Text.Trim() == "0.00")
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.Red;
                myImage.ImageUrl = "media/images/redball.gif";
            }
            else
            {
                //e.Row.Cells[3].BackColor = System.Drawing.Color.Yellow;
                myImage.ImageUrl = "media/images/yellowball.gif";
            }
        }
    }


    protected void bSaveFin1_Click(object sender, EventArgs e)
    {
        try
        {
            if (email == null)
            {
                throw new Exception("email address is missing");
            }
            else if ((this.tbCommFin1.Text != null) && (email != null))
            {
                DropDownList ddlFac = (DropDownList)Master.FindControl("ddlFacility");
                DropDownList ddlYear = (DropDownList)Master.FindControl("ddlYear");
                DropDownList ddlQtr = (DropDownList)Master.FindControl("ddlQuarter");
                insertComment(ddlFac.SelectedItem.Value, email, "FIN1", tbCommFin2.Text, ddlQtr.SelectedItem.Value, ddlYear.SelectedItem.Value);
            }
        }
        catch (Exception)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "myAlert", "<script language='javascript'>alert('FIN1: Email address is missing, contact Matt Cushing in IT Dept');</script>");
        }
    }
    protected void bSaveFin2_Click(object sender, EventArgs e)
    {
        try
        {
            if (email == null)
            {
                throw new Exception("email address is missing");
            }
            else if ((this.tbCommFin2.Text != null) && (email != null))
            {
                DropDownList ddlFac = (DropDownList)Master.FindControl("ddlFacility");
                DropDownList ddlYear = (DropDownList)Master.FindControl("ddlYear");
                DropDownList ddlQtr = (DropDownList)Master.FindControl("ddlQuarter");
                insertComment(ddlFac.SelectedItem.Value, email, "FIN2", tbCommFin2.Text, ddlQtr.SelectedItem.Value, ddlYear.SelectedItem.Value);
            }
        }
        catch (Exception)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "myAlert", "<script language='javascript'>alert('FIN2: Email address is missing, contact Matt Cushing in IT Dept');</script>");
        }
    }
    protected void bSaveFin3_Click(object sender, EventArgs e)
    {
        try
        {
            if (email == null)
            {
                throw new Exception("email address is missing");
            }
            else if ((this.tbCommFin3.Text != null) && (email != null))
            {
                DropDownList ddlFac = (DropDownList)Master.FindControl("ddlFacility");
                DropDownList ddlYear = (DropDownList)Master.FindControl("ddlYear");
                DropDownList ddlQtr = (DropDownList)Master.FindControl("ddlQuarter");
                insertComment(ddlFac.SelectedItem.Value, email, "FIN2", tbCommFin3.Text, ddlQtr.SelectedItem.Value, ddlYear.SelectedItem.Value);
            }
        }
        catch (Exception)
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "myAlert", "<script language='javascript'>alert('FIN3: Email address is missing, contact Matt Cushing in IT Dept');</script>");
        }
    }


    public void insertComment(string facID, string submitter, string measure, string comment, string qtr, string year)
    {
        try
        {
            //automatically update status for the contract so they can see where they are from the contracttablepage
            string select = "insert into ScoreCardEntryComments (facID, submitter, measure, comment, qtr, year entryDate) Values(";
            select = select + facID + ",'" + submitter + "','" + measure + "','" + comment + "'," + qtr + "," + year + ",'" + System.DateTime.Now.ToString() + "')";

            conn = new SqlConnection(source);
            conn.Open();
            cmd = new SqlCommand(select, conn);
            cmd.ExecuteNonQuery();

        }
        catch
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "myAlert", "<script language='javascript'>alert('Problem inserting comment');</script>");
        }
        finally
        {
            conn.Close();
        }

    }
    decimal Measure1Total;
    decimal Measure2Total;
    public decimal GetMeasure1Total(string Measure1)
    {
        if (Measure1 != null)
        {

            Measure1Total += decimal.Parse(Measure1);
            return decimal.Parse(Measure1);
        }
        else
        {
            return 0;
        }
    }
    public decimal GetMeasure2Total(decimal Measure2)
    {
        Measure2Total += Measure2;
        return Measure2;
    }
    public decimal Get1Total()
    {
       return Measure1Total;
    }
    public decimal Get2Total()
    {
        return Measure2Total;
    }
}
 

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Developing Solutions with Microsoft InfoPath Authors: Patrick Halstead, Matthew Blain, Vani Mandava Teredesai, Pages: 416, Published: 2004
Programming Python Authors: Mark Lutz, Pages: 1552, Published: 2006
Macromedia ColdFusion MX 7 Web Application Construction Kit: web application construction kit Authors: Ben Forta, Raymond Camden, Leon Chalnick, Angela C. Buraglia, Pages: 1440, Published: 2005
Professional ADO.NET 2: Programming with SQL Server 2005, Oracle, and MySQL Authors: Wallace B. McClure, Gregory A. Beamer, John J. Croft, John J. Croft, IV, J. Ambrose Little, Bill Ryan, Phil Winstanley, David Yack, Jeremy Zongker, Pages: 614, Published: 2005
Python Scripting for Computational Science Authors: Hans Petter Langtangen, Pages: 750, Published: 2008
Learning PHP 5: A Pain-free Introduction to Building Interactive Web Sites Authors: David Sklar, Pages: 350, Published: 2004
Programming Web Services with Perl Authors: Randy J. Ray, Pavel Kulchenko, Pages: 470, Published: 2003
Foundations of Security: What Every Programmer Needs to Know Authors: Neil Daswani, Christoph Kern, Anita Kesavan, Pages: 290, Published: 2007
Java Servlet and JSP Cookbook: Practical Solutions to Real-world Problems Authors: Bruce W. Perry, Pages: 723, Published: 2004

Web:
After changing url params d req checkboxes are not showing as ... After changing url params d req checkboxes are not showing as clicked in jsf programming. Expert:jeetendra .... Submit search form ...
Submit form with URL parameters : HTML Java Script, HTML Java Script I want to submit a form with URL , by clicking on a link . My page name is MyPage.php Here is what am doing . echo Search...
free multiple submit url - flash math creativity secret url ... flash math creativity secret url, change url on my space, tracking image url .... url params c, background url images, accronym url, add networking url ...
Download UrlParams, UrlParams 2.2.0 Download Oct 16, 2008 ... [Submit (new Tab)]: well... the candidate which guesses what this button does, wins 100 points! you can free download UrlParams 2.2.0 now. ...
Google Url Parameters submit "url parameters" · google api search change gl parameter · adtest=on google · google as_qdr · google maps url parameter output=embed ...
Search Submit Basic - FAQ What happens if I change the URL of my Web site after I subscribe to this service ... driven from URL parameters. That is, you may submit pages of the form: ...
[#ETHREEOH-487] Surf: unable to access http parameters in chromed ... But, if I change the form to submit to the full url (so the page doesn't have the ... I'm unable to submit a form or otherwise pass http parameters and have ...
UrlParams Sometimes usefull, if UrlParams doesn't update its contents properly. [Submit]: Submits the query (composed of the aboves URL, the Referer and the GET/POST ...
Update record problem! URL.param confusion :-S - Dev Shed Oct 31, 2008 ... URL.param confusion :-S in the ColdFusion Development forum on Dev Shed. ..... but when i submit the form, i go to a thank you page where it ...
hwg-techniques archive: Re: Image as submit button shows ... Re: Image as submit button shows parameters in URL ... border="0" name="submit" value="submit"> > > To create an image that's a submit button for my form. ...

Videos:
Developing and deploying an application on Google App Engine This video introduces developers to building apps on Google App Engine. For more in-depth information and deep-dive technical sessions, come to Googl...
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming environmen...
How To Break Web Software - A look at security vulnerabilities in web software Google TechTalks April 13, 2006 Mike Andrews Mike Andrews is a senior consultant who specializes in software security and leads the web application...




Search This Site:










accessing the profile object.

there is no consumer connection point 'imessageconsumer' on 'bla [2]'.

active directory authentication & autorization

subclassing from the personalization providers

webparts in a multiview

question about using webparts

track performance and loading time

pass data from page to custom profile provider

web parts not working in firefox 2.0 and ie 6.0

how often does profile auto-save its data to the database?

how do i stop a web part from caching its data?

initialization of complex types

webpart in a assmybly / deployment problem

personlization of pages

authorizationfilter not updated

html, php and asp.net-pages in webparts?

i'm having trouble deleting webparts programmatically

removing personalization for one specific webpart

is there a sample webconfig for from the internet webpart

from a user control to a webpart file?

chat module

how to get start using web part in vs.net2003, help!

use div instead of table when rendering webparts, and howto override webpartbasezone

strange behavior when programmatically adding webpart to a webpartzone

generic list as a web part property.

sharepoint error

limit to one webpart type per page?

turn off sql 2005 dependency

webpart manger err ..!

numbers of online anoynomus users

  Privacy | Contact Us
All Times Are GMT