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
S

simsen

@simsen
About
Posts
64
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help in understanding PopupControlExtender
    S simsen

    Hi, First what my goal is: I want when clicking on a button on my page a popup to appear with a list of images. When clicking on a image it should add som text (the name of the image) to a textbox on the page. In first place I only try to let the popup appear when clicking the textbox because I don't know how to set the name of the image from the button. My aspx code:

    <table cellpadding="0" width="100%" border="0">
                                            <tr>
                                                <td style="text-align: right">
                                                    <asp:Label ID="lblMessage" runat="server" Text="<%$ Resources:Resource, Message %>"></asp:Label> :&nbsp
                                                </td>
                                                <td style="text-align: left; width: 510px">
                                                    <asp:TextBox Id="txtMessage" runat="server" onfocus="this.value = this.value;" MaxLength="250" Width="500px" />    
                                                </td>
                                                <td style="vertical-align: top">
                                                    <asp:Button Id="btnSend" CssClass="button" runat="server" Text="<%$ Resources:Resource, Send %>" OnClientClick="SetScrollPosition()" OnClick="BtnSend_Click" />                                                
                                                </td>
                                                <td style="width: 200px">
                                                    <asp:ImageButton ID="ibtnSmileys" runat="server" ImageAlign="AbsMiddle" ImageUrl="~/Images/Smiley_41_20_A.gif" />
                                                    <asp:Panel ID="panSmileys" runat="server" CssClass="chatSmileyPanel">
                                                        <asp:UpdatePanel ID="upanSmileys" runat="server">
                                                            <ContentTemplate>
                                                                <asp:DataList ID="dlstSmileys" runat="server" RepeatColumns="7" RepeatDirection="Horizontal" Width="100%" CellPadding="2" CellSpacing="2" OnItemCommand="dlstSmileys_ItemCommand">
                                                                    <ItemTemplate>
    
    ASP.NET sysadmin help tutorial learning

  • Solution file in VS.NET 2005
    S simsen

    Look in My Documents\Visual Studio 2005\Projects or WebSites :-)

    ASP.NET csharp visual-studio

  • Capture enter key in textbox
    S simsen

    Wrap a panel around these two controls and then in the Panel write this: DefaultButton="YourButtonIdHere"

    ASP.NET help question

  • unable to use .test AJAX controls
    S simsen

    Do you have the framework 3.5 sp1 installed?

    ASP.NET help csharp asp-net design discussion

  • Error in Webconfig file.
    S simsen

    If you have any backup folder (with a web.config) in your web application folder, you have to move that backup folder outside your application folder. Kind regards, simsen :-)

    ASP.NET help windows-admin question

  • Scope of Object Variables
    S simsen

    Hi, Why do you make your connection int he Page_Load? I cannot see the reason for doing this. Why not in the skysconnection() method? Kind regards simsen :-)

    ASP.NET csharp asp-net design help

  • i want to create widgets in asp.net 2.0 .can u plz guide me how to develop widgets using 2.0?
    S simsen

    dev.netvibes.com/doc/[^]

    ASP.NET tutorial csharp asp-net question

  • About Mail
    S simsen

    Hi kiranreddy, Try this:

    using System.Net.Mail;
    protected void btnSendMessage_Click(object sender, EventArgs e)
    {
    SmtpClient smtpClient = new SmtpClient();
    MailMessage message = new MailMessage();

    try
    {

        MailAddress fromAdress = new MailAddress("YourSenderEmail", "NameThatSendTheMessage");
    
        smtpClient.Host = "YoursmptClientHost";
    
        smtpClient.Port = 25; //Which port the smtpClient sends on
    
        message.From = fromAdress;
    
        message.To.Add("MailAdressToWhoShouldRecieveTheMail");
        message.Subject = "The message subject";
    
        message.IsBodyHtml = false;
    
        message.Body = "The message went here";
    
        smtpClient.Send(message);
        lblSendOk.Visible = true;
    }
    catch (Exception ex)
    {
        //Here I show an error, if any
        lblSendError.Visible = true;
        lblSendError.Text = lblSendError.Text + " .<br />" + ex.Message;
    }
    

    }

    If you have any trouble with the above code, you have to tell what exactly the error gives and copy your code, so we can see, if you have done anything else. Kind regards, simsen :-)

    ASP.NET csharp asp-net learning

  • textbox entry restrict
    S simsen

    Here is a hole bunch of examples - also what you need: [regexlib.com/DisplayPatterns.aspx]

    ASP.NET tutorial

  • textbox entry restrict
    S simsen

    Hi Kissy, Look at RegularExpressionValidator and CompareValidator [regular-expressions.info] Kind regards, simsen :-)

    ASP.NET tutorial

  • Gridview page change is affecting sessions
    S simsen

    If you have the code in a if (!IsPostBack) it will only run when the page loads and not each time there is a post back. Is this the case here?

    ASP.NET question help

  • Disabling all fields in new way?? using asp.net??
    S simsen

    Hi, You can do something like that with javascript - it's like a curten (I don't know if I translated it well) - I know there is a bunch of these on the javascript pages on the net.... Try to google it :-)

    ASP.NET csharp asp-net tutorial question

  • Hi All I am new to Ajax
    S simsen

    Why do you have: <form id="form1" runat="server"> and <asp:scriptmanager id="ScriptManager1" runat="server"> In my opinion these to should bee on your MasterPage and not on the content page I had a project where I used tabs on a content page without any problems...... Try to move this two and then run it again..... Kind regards, simsen

    ASP.NET help docker

  • Gridviw - my rowCommand does not run
    S simsen

    DOHHHHHHH..... In my pageload event I updated the gridview without a (!IsPostBack).........

    C# sysadmin debugging question

  • Gridviw - my rowCommand does not run
    S simsen

    Hi, I have a gridview, with a rowcommand. When I try to debug I can see it dosn't call the rowCommand (DeleteImage) Please can anyone tell me, why it does not run that rowCommand? my code:

    <asp:GridView ID="grdImages" runat="server" AutoGenerateColumns="false" 
                                AutoGenerateEditButton="false" BorderColor="Transparent" 
                            CellPadding="2" GridLines="vertical" 
                                CellSpacing="0" DataKeyNames="filename"
                                ForeColor="Black"
                                ShowHeader="false" onsorting="grdImages_Sorting" 
                            onrowcommand="grdImages_RowCommand">
                            <RowStyle BorderStyle="Dotted" />
                            <Columns>            
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <img src='<%#Eval("imgImage")%>' alt="Image" width="50px" height="50px" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Label ID="filename" runat="server" Text='<%#Eval("filename")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>                               
                                        <asp:Button CssClass="buttonsSmall" ID="btnDeleteImage" OnClientClick="return confirm('Billedet vil ikke længere kunne vises på livesitet. Er du sikker på, du vil slette billedet?');" Font-Size="8pt" runat="server" Text="Slet" CommandName="DeleteImage" CommandArgument='<%# Eval("filename")%>'  />
                                    </ItemTemplate>
                                    <HeaderStyle />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle CssClass="rowcolor" />
                            <AlternatingRowStyle CssClass="alternatingrowcolor" />        
                        </asp:GridView>
    
    
    protected void grdImages_RowCommand(object sender, GridViewCommandE
    
    C# sysadmin debugging question

  • Programmatically select a treeview node and expand the depth
    S simsen

    Hi, I have a treeview I use as a menu. The treeview works perfect. BUT now I want to make a function where I add a new node to the menu programmatically. (I don't need help to add the new node in the database) I need help for: reload the menu and select the newly added node and expand the treeview to that node. I tried a lot, but nothing works for me. Said with other words: I need a way to expand the treeview and make a specific node selected I hope someone here can help me with my problem :-) My code:

    TestMenu.aspx:

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:TreeView ID="MenuTree" EnableClientScript="False" runat="server"

    ExpandDepth="15" ShowExpandCollapse="False"
    ontreenodeexpanded="MenuTree_TreeNodeExpanded"

    ontreenodepopulate="MenuTree_TreeNodePopulate"
    PathSeparator="/" ontreenodecollapsed="MenuTree_TreeNodeCollapsed">

    <NodeStyle CssClass="menulink" />

    <SelectedNodeStyle CssClass="menulink" />

    </asp:TreeView>

    <br /><br /><br />

    ID:

    <asp:Label ID="lblMenuId" runat="server" Text="Label"></asp:Label>

    <br /><br />

    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    </asp:Content>

    TestMenu.aspx.cs:

    public partial class TestMenu : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
    {
    //16-06-2008 AS
    //Get the top menu
    try
    {
    DALMenu menu = new DALMenu();
    if (menu.EditGetTopMenu(MenuTree) == Status.Success)
    {
    }
    }
    catch
    { }
    }
    }

    protected void MenuTree\_TreeNodePopulate(object sender, TreeNodeEventArgs e)
    {
        if (e.Node.Depth == 0)
        {
            try
            {
                DALMenu submenu = new DALMenu();
                submenu.EditGetSubMenu(e.Node);
            }
            catch
            { }
        } 
    
    }
    protected void MenuTree\_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
    {
        try
        {
            int key\_id = Convert.ToInt32(e.Node.Value);
    
            lblMenuId.Text = key\_id.ToString();
    
            if (e.Node.Depth == 0)
            {
                TreeView t = (TreeView)sender;
    
                for (int i = 0; i < t.Nodes.Count; i++)
    
    ASP.NET help database design sysadmin

  • reference asp.net login password textbox
    S simsen

    Hi .netman, If I understand your question you need to find out the id of the password textbox...... That will bee Password How to find out: Go in Design mode on the page where you have the login control. Use the arrow for the login and choose "Convert to template" Now you can place your curser on that field you want to see the Id on and then look in the Properties window. Kind regards, simsen :-)

    ASP.NET csharp asp-net question

  • Dynamic User control load get a parameter
    S simsen

    Hi Josh When I try this, an then click on a button that is in the user control the control disappear... How can I get the user control to appear again (I have to get the user control from it self)

    ASP.NET csharp winforms design sysadmin security

  • Dynamic User control load get a parameter
    S simsen

    Thank you very very much...... It was what I needed...... Now I only have to figure out, how I get it without to have to push the button twice (I know it's becauce of the page_load comes before the btnPush_Click and I have to make an instans of the user control each time I load the page) I wil use some times of this problem before I get back to this forum for help.... But again thank you very much for your help. It helped me very much :-)

    ASP.NET csharp winforms design sysadmin security

  • Dynamic User control load get a parameter
    S simsen

    I don't understand that you say that the control doesn't contain this property..... If you see the ascx.cs you can se I have made a public property?

    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 UserControls_TestSetProject : System.Web.UI.UserControl
    {
    private string _ProjectId = "";

    public string ProjectId
    {
        get { return \_ProjectId; }
        set { \_ProjectId = value; }
    }
    
    protected void Page\_Load(object sender, EventArgs e)
    {
        lblEditProjectNameHeadline.Text = ProjectId;
    }
    

    }

    ASP.NET csharp winforms design sysadmin security
  • Login

  • Don't have an account? Register

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