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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

Ahmed Galal

@Ahmed Galal
About
Posts
96
Topics
36
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ASP.NET Control Custom Attribute
    A Ahmed Galal

    your right it shouldnt differ between framework versions, i just doubted myself that they changed the way of rendering control or somethin. thanks again.

    ASP.NET csharp javascript html asp-net sysadmin

  • ASP.NET Control Custom Attribute
    A Ahmed Galal

    yea that would work although i was looking for a simpler method, i think hidden field is the way to go unfornatually, but thank u very much for answering.

    ASP.NET csharp javascript html asp-net sysadmin

  • ASP.NET Control Custom Attribute
    A Ahmed Galal

    am just trying to figure out a way that could make it work, u think theres no way to read my custom attributes in code-behind ? or by any chance i could render this attribute to the ViewState or making it a control attribute like the others ? i think i will go for the hidden fields if i failed on this. thanks again

    ASP.NET csharp javascript html asp-net sysadmin

  • ASP.NET Control Custom Attribute
    A Ahmed Galal

    yes exactly, and it doesnt work :S and as i said before, if i tried to change any of the control attributes like value it works fine, i assume that the ViewState doesnt save my new custom attribute, dunno whats wrong .. i'm using .net 4 but i also tried on .net 2.0, and its the same. thanks for ur time

    ASP.NET csharp javascript html asp-net sysadmin

  • ASP.NET Control Custom Attribute
    A Ahmed Galal

    am just trying to add a custom attribute with the id of what he wrote in the TextBox in a custom attribute, i know i could use hidden field and it would work just fine, but am tryin to look for a clean clean solution, and also wondering why it doesnt work.. thanks for reply

    ASP.NET csharp javascript html asp-net sysadmin

  • ASP.NET Control Custom Attribute
    A Ahmed Galal

    I'm tryin to add a custom attribute in the html of a TextBox control in an asp.net page, like the following:

    <asp:TextBox runat="server" ID="txtUserName" myAttr="10" ></asp:TextBox>

    when i try to change this attribute from javascript and then read it in the code-behind, i dont get the changes, however if i changed any of the other control attributes like value, it works just fine. i dont know why i cant add my own attributes. is there anything i should do to tell the asp.net to render my new custom attribute to the viewstate so i can read it later in the code-behind? i would appreciate any help. thanks in advance.

    ASP.NET csharp javascript html asp-net sysadmin

  • Visual Studio 2010 RC expiration date
    A Ahmed Galal

    great man, thanks:thumbsup:

    Visual Studio csharp announcement dotnet visual-studio question

  • Visual Studio 2010 RC expiration date
    A Ahmed Galal

    i was wondering when does the RC version of the visual studio 2010 is going to be expired on my machine, coz i am worried about using it and use.net framework on a real project and then suddenly get a message that tell me "that this version is expired coz of the release of RTM or whatever". before i get the RTM version. so by any chance does anyone know when this version might expire ? Thanks in advance.

    Visual Studio csharp announcement dotnet visual-studio question

  • updating in entity framework
    A Ahmed Galal

    in my asp.net edit page, i load an entity and its childs from my context and save it in the Application object to preserve it during page postbacks, doing this will make my entity lose its context so i have to reattach it when the user finally click edit. the problem is when i reattach and call SaveChanges and ApplyPropertyChanges only the main entity get updated and not the childs. i have tried to attach the child entities too using AddObject or Attach but i always get exceptions like "An object with a temporary EntityKey value cannot be attached to an object context." OR "An entity object cannot be referenced by multiple instances of IEntityChangeTracker." my code look like this:

            var originalEntity = (from x in verifiersDB.VerificationHosts where x.ID == ID select x).FirstOrDefault();
    
            originalEntity.VerificationHostSearchs.Load();
            verifiersDB.Attach(originalEntity);
    
            foreach (var l in verificationHost.VerificationHostSearchs)
                verifiersDB.AddObject("VerificationHostSearchs",l);  //calling AddObject or Attach will throw an exception
            
            verificationHost.Type = short.Parse(ddlHostType.SelectedValue);
            verificationHost.HostName = txtHostName.Text;
            verificationHost.Description = txtHostDescription.Text;
            verificationHost.HostUrl = txtHostURL.Text;
    
            verifiersDB.ApplyPropertyChanges("VerificationHosts", verificationHost);
    
            verifiersDB.SaveChanges();
    

    verificationHost is retrieved from the Application state Any help will be appreciated. Thanks in advance.

    LINQ help csharp asp-net

  • CheckBoxList and PostBack
    A Ahmed Galal

    yea i think too ... thanks much for ur time.

    ASP.NET help question

  • CheckBoxList and PostBack
    A Ahmed Galal

    i think the checkboxlist has a problem, i know that the datasource should remain after post backs and thats all controls do except the checkboxlist, i dunno and yea, i do set attributes and hidden fields to read the data and it works fine, the problem is that i cant read the datasource of the checkboxlist after postbacks. any idea ? thanks for replying

    ASP.NET help question

  • CheckBoxList and PostBack
    A Ahmed Galal

    i have a CheckBoxList inside a DataList, i bind the CheckBoxList in the DataList ItemDataBound event, everything is working fine except that i lose the datasource of the checkboxlist within any postback, i bind my datalist in the Page_Load event inside if(!IsPostBack) .. i know i could bind my datalist outside this if condition and that should make it work, but it will cause re-loading the data every postback beside i did some clientside scripting that lets the user manipulate some controls without postback, so the data will not look the same if i reloaded it everytime. i hope theres a solution or any workaround any help ? thanks in advance.

    ASP.NET help question

  • Sending e-mails with unicode encoding
    A Ahmed Galal

    i have no problem in sending the email, but my problem is that theres some unicode characters in the email which is not readable when viewed at the client. however i used UTF-8 encoding like:

    mMessage.SubjectEncoding = System.Text.Encoding.UTF8;
    mMessage.BodyEncoding = System.Text.Encoding.UTF8

    heres what i do from the begining i first open an html file and get its content in a string

    sr = File.OpenText(System.Web.HttpContext.Current.Server.MapPath(@"~\Controls\Mailer\Templates\common.htm"));
    mystring = sr.ReadToEnd();

    then i replace some words in the string with my own, like:

    mystring = mystring.Replace("%name%","unicode word");

    and finally i send this string as html in the email body. only the replaced words is not readable but the other unicode characters that was originally in the htm file is fine ! am using c# asp.net 2.0 i also want to note that everythin was going fine in .net 1.1 , that happened only when i switched to .net 2.0 can u please find any solution ? i will really appreciate any idea thanx in advance. We never stop learning

    ASP.NET csharp html asp-net wpf sysadmin

  • Control.Render in .NET 2.0
    A Ahmed Galal

    that make sense :) thank u very much

    ASP.NET help csharp asp-net sysadmin question

  • Control.Render in .NET 2.0
    A Ahmed Galal

    i'm trying to call GridView.Render() on a webform, but i always get an error saying "that i must place my control in a form with runat='server'" however am sure that my control is in a form and also set to runat server, i'm also sure that the GridView don't have any other asp.net child controls like checkbox added to it, i just want to mention that it works fine in .NET 1.1 using datagrid or any other control but it don't work in .NET 2.0 so, is it a bug ? or i'm doing somethin wrong ? well, i hope to find a solution thanx in advance.

    ASP.NET help csharp asp-net sysadmin question

  • Positioning the page after PostBack
    A Ahmed Galal

    yea, i think smart navigation will work, just add SmartNavigation="true" in ur page directive and lets see if will work.

    ASP.NET help

  • javascript to change url
    A Ahmed Galal

    how can i change the url in the browser without reloading the page or move it to anywhere. i just want to change the appearance of the url in the browser so when someone copy the url he get the exact parameters. thanx in advance. -- modified at 11:56 Sunday 5th March, 2006

    ASP.NET javascript question

  • Asp.net session problem
    A Ahmed Galal

    sessions will be closed by default when the browser is closed and the Session_End event will be fired in the global.ascx file, i think u need to use cookies to recognize logged-in users.

    ASP.NET help csharp asp-net com

  • edit the action attribute in the html form element
    A Ahmed Galal

    yea you are right, after thinking about it, i was talking to myself how the hell the form gonna post back if i changed the action of the form and i don't know how asp.net 2.0 gonna handle it so am waiting to see. thanks for ur help.

    ASP.NET html question

  • edit the action attribute in the html form element
    A Ahmed Galal

    why everytime i try to edit the action attribute of the form element in my aspx page and then open the page in the browser and view source, i found it replaced with current page name and i don't want that, i'm trying to do this coz i want to post this form to another url any suggesstions ?

    ASP.NET html question
  • Login

  • Don't have an account? Register

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