Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

laziale

@laziale
About
Posts
226
Topics
95
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ajax popup extender black background around the window
    L laziale

    Hello - I hope someone can help me with this. I have ajax modal popup extender, and when the popup will be open I want the surrounding of the window to be with black background. Can someone help me with that? Thx, Laziale

    ASP.NET help question

  • Programmatically Update SqlDataSource
    L laziale

    why don't you create a sql stored procedure, send the parameters and update the table which you want to be updated. It's really easy to update a field programatically. Check this link for more info regarding stored procedure and this link for playing with stored procedures in asp.net hope that can help, Laziale

    ASP.NET design help announcement

  • using eval and databind in html part of file
    L laziale

    Hello guys - can someone point me to some proper article where I can learn how to use databinding in the html part of the page. I searched google but I didn't find anything useful. Thanks in advance

    ASP.NET html tutorial

  • .net webservices tracking usps and ups
    L laziale

    Thanks for your answer. So in order to use the ups tracking code webservice I will need to contact UPS or...?

    ASP.NET csharp question

  • .net webservices tracking usps and ups
    L laziale

    Hello - do you guys know if there are some webservices out there which we can call for getting tracking info for shipped items? Thx, Laziale

    ASP.NET csharp question

  • if statement in the html code in aspx page
    L laziale

    First, thanks for your reply. I tried that thing too, but I am getting no value for the label. Here is what I have: in the html part:

    <div style="padding-left: 10px; padding-right: 10px; text-align: left; width:45%">
    <asp:Label ID="lblFirstName" runat="server" Text='<%#Server.HtmlEncode(Eval("FirstName").ToString())%>'></asp:Label>
    </div>

    in the code behind:

    protected void gvPpl_DataBound(object sender, GridViewRowEventArgs e)
    {

            for (int i = 0; i < gvPpl.Rows.Count; i++)
            {     
                Label lblL = (Label)gvPpl.Rows\[i\].Cells\[2\].FindControl("lblFirstName");
                Label lblL1 = (Label)gvPpl.Rows\[i\].Cells\[1\].FindControl("lblFirstName");
                Label lblL2 = (Label)gvPpl.Rows\[i\].Cells\[0\].FindControl("lblFirstName");
                Label lblL3 = (Label)gvPpl.Rows\[i\].Cells\[3\].FindControl("lblFirstName");
            }
        }
    

    I am trying with different cells, just in case I have the wrong cell, but that is not helping, all the labels have no text. Any advice? Thx, Laziale

    ASP.NET html sysadmin help tutorial

  • if statement in the html code in aspx page
    L laziale

    I am trying this on button event:

    for (int i = 0; i < gvPpl.Rows.Count; i++)
    {
    Label lblL = (Label)gvPpl.Rows[i].Cells[2].FindControl("lblFirstName");
    }

    but nothing comes up. Can you give me some example how I can do that, and how I can set the forecolor afterwards. Eval container was there before I started working on this code. Please advice if I can/need to use something else and still get the same data. Thx, Laziale

    ASP.NET html sysadmin help tutorial

  • if statement in the html code in aspx page
    L laziale

    I am trying to solve this issue in the code behind file, but I am trying almost two days now without any success. The thing is that the label is in templatefield within gridview and I am having hard time to solve how I can get to the label in the gridview, check the text and set the forecolor depending on the text. If you have good example how I can solve this in code behind file I will be more then pleased to accept that. Thanks, Laziale

    ASP.NET html sysadmin help tutorial

  • if statement in the html code in aspx page
    L laziale

    Hello, I want to create if statement in the html part of my site. Can someone help me with that and give me some example. I have a label and depending from the text, the forecolor to be different. Here is what I have:

    <asp:Label ID="lblFirstName" runat="server" Text='<%#Server.HtmlEncode(Eval("FirstName").ToString())%>'></asp:Label>

    So depending on the text, for example if the text contains 'John' text will be in red, if the text contains 'Jim' text will be in blue. Thanks for any advice, Laziale

    ASP.NET html sysadmin help tutorial

  • change forecolor of a label in gridview [modified]
    L laziale

    ok, there were two events for the same thing, that why it wasn't triggered. Now its triggered, but for some reason when I am stepping in to the code the label property doesn't get the text. Its left empty. Here is the code:

     void gvOrderProductVariants\_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label lblFirstName= (Label)e.Row.FindControl("lblFirstName");
                if (lblFirstame.Text.Contains("John"))
                    lblFirstName.ForeColor = System.Drawing.Color.Red;
            }
    
         
        }
    

    Please tell me if I am doing something wrong. Thx, Laziale

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    I can't get to the 'e' argument since the databound event is using EventArgs. :( Thanks for your help though

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    nothing is happening with that one, I have the event set but its not triggered at all. The page loads without triggering that event. But thanks for your help anyway. Laziale

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    cause I want to display the proper color before the site is rendered on the screen. Is there a way how I can trigger that event in the Page_Load? Thanks, Laziale

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    Thanks for all your help. I have one question, since I am trying to figure out the color of the label in the page_load event, is there anyway how I can assign the color depending from the text in that label? Thx, Laziale

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    I just removed the and tags because of some formatting issue of the site :).

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    can you give me some example how I can do ItemDataBound event? Thanks for your help

    ASP.NET sysadmin

  • change forecolor of a label in gridview [modified]
    L laziale

    Hello - I want to change the forecolor of a label in a gridview I have, depending on the text in that label. I can't access the label by the ID in the code-behind to get the properties. The label is part of templatefield: <div> <asp:Label ID="lblFirstName" runat="server" Text='<%#Server.HtmlEncode(Eval("FirstName").ToString())%>'></asp:Label> </div> Thx, Laziale

    modified on Monday, March 15, 2010 3:54 PM

    ASP.NET sysadmin

  • How to get the index of the gridview with click of asp button
    L laziale

    there is no rowIndex under EventArgs e. I have just Equals, GetHashCode, GetType and ToString. Thx for your help though. Laziale

    ASP.NET database tutorial

  • How to get the index of the gridview with click of asp button
    L laziale

    hello thx for your reply and here is my code: backend:

    protected void updateNote(object sender, GridViewCommandEventArgs e)
    {
    string selectedIndex = "";
    int index = 0;
    index = Convert.ToInt32(e.CommandArgument);
    // index = 1;
    // Button bttn = (Button)sender;

         GridViewRow row = gvOrderNotes.Rows\[index\];
        
             ListItem item = new ListItem();
            item.Text = Server.HtmlDecode(row.Cells\[3\].Text);
            selectedIndex = item.Text;
        }
    

    html:

    <ItemTemplate>
    <asp:Button runat="server" ID="ChkUpdate" onclick="updateNote" AutoPostBack="true" Width="160%" Text="Update Order"/>
    <ajaxToolkit:ConfirmButtonExtender ID="chkUpdateConfirmBtnExtender" runat="server" TargetControlID="chkUpdate" DisplayModalPopupID="modalPopupExtenderChkUpdate"></ajaxToolkit:ConfirmButtonExtender>
    <ajaxToolkit:ModalPopupExtender ID="modalPopupExtenderChkUpdate" runat="server" TargetControlID="chkUpdate" PopupControlID="pnlChkUpdate"
    OKControlID="chkUpdateOK" CancelControlID="chkUpdateCancel" BackgroundCssClass="modalBackground" />
    </ItemTemplate>

    Thx for your help one more time. Laziale

    ASP.NET database tutorial

  • How to get the index of the gridview with click of asp button
    L laziale

    Hello - I want to get the index of the row where the button is clicked. Please note that I am using EventArgs, not GridViewCommandEventArgs, since with GridViewCommandEventArgs nothing is happening, once the button is clicked. Thx, Laziale

    ASP.NET database tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups