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
M

Morgs Morgan

@Morgs Morgan
About
Posts
208
Topics
51
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • PHP Static Url Rewrite
    M Morgs Morgan

    Hi people, I'm fairly new to php and I would like to know how to rewrite a static url to a friendly url. E.g. Rewrite: - http://site.domain.com/**buy\_products.html** to - http://site.domain.com/**buy-products** or /index.html to /home I tried this and did not work:

    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteRule ^home index.html
    RewriteRule ^wine-range wine_range.html

    I will appreciate your help. I've googled and the examples I come across are mostly converting dynamic urls to static. Regards, Morgs

    Linux, Apache, MySQL, PHP php html database com help

  • Comparing array of strings
    M Morgs Morgan

    Yes, you can use List if you want. The ArrayList comes from the: using System.Collections;

    ASP.NET help csharp asp-net data-structures performance

  • Comparing array of strings
    M Morgs Morgan

    indian143 wrote:

    I have an asp.net application which loads data from csv file. I need to check for duplicate rows in the csv file and should not process them and give error message for those duplicate rows.

    Here's my approach:

    //list to add lines in your csv file
    ArrayList uniqueLines = new ArrayList();
    ArrayList duplicateLines = new ArrayList();

    //Read all lines from your csv file
    String[] lines = File.ReadAllLines( "C:/file.csv" );//passing the file path

    foreach ( String line in lines )
    {
    if ( !uniqueLines.Contains( line ) )
    {
    uniqueLines.Add( line );
    }
    else
    {
    duplicateLines.Add( line );
    }

    }

    From the above, you have all the unique lines in the uniqueLines arraylist and you have duplicate lines in the duplicateLines arraylist. To display errors, loop through the "duplicateLines" and tell the user about the error. Happy Coding, Morgs

    ASP.NET help csharp asp-net data-structures performance

  • how to dynamically add textboxes
    M Morgs Morgan

    Seeing that this is posted under asp.net i will give you a client side solution in "jQuery":

    function GenerateTextBoxes( sender )
    {
    var txtBoxHtml = '';
    sender.append( txtBoxHtml );//this will append a new textbox to the already existing ones
    }

    To make it easier for you, i added a css class (text-boxes) that you can later use to retrieve the values of your textboxes if need be and below is how you can achieve that using "jQuery":

    function GetTextBoxValues()
    {
    var arrayOfValues = [];
    $( '.text-boxes' ).each( function(){//loop through all the textboxes with this class names
    if( $(this).val() != '' )
    {
    arrayOfValues.push( $(this).val() ); //and add the values to an array
    }
    });
    }

    Hope that helps, Morgs

    ASP.NET help tutorial

  • Rotate element without rotating images!
    M Morgs Morgan

    MajinSaha wrote:

    If you want to put all the properties inside one element, don't bother answering.

    Please never restrict people from giving an answer closer to their understanding, if i were me i would simply get put off :( in answering this question! Anyway, one known way to add different styling to elements is basically to use different class names on such elements or carefully put inline styling on the element itself. I'm assuming that you have:

    This is the text you would like to transform!

    Above you have a "div" with a background image and a "p" inside a "div". To transform the text inside the "p" alone, simply add your transformation css effects to the extra class i put in place on the "p" which is: "txtTransform" like so:

    .txtTransform
    {
    transform:skew(-20deg,0deg);
    -ms-transform:skew(-20deg,0deg); /* IE 9 */
    -moz-transform:skew(-20deg,0deg); /* Firefox */
    }

    That's the basic way to separate css effects, using different class names for general and specific elements. Happy coding, Morgs

    Web Development help css

  • asp.net keypress event
    M Morgs Morgan

    Use a javascript/jquery function to achieve this: 1. HTML Mockup

    Above, "onkeypress" is the client-side keypress event. For more accuracy, you could replace "onkeypress" with "onkeyup" which only fires when you let go of a "key" (on your keyboard). 2. Javascript/jQuery

    function Validate( sender )
    {
    if( parseInt( sender.val() ) )
    {
    //proceed with the intended operation
    }
    else
    {
    alert( 'Sorry, only whole numbers are allowed in this input field. Please try again.' );
    }
    }

    ASP.NET csharp asp-net regex tutorial question

  • Java script for gridview
    M Morgs Morgan

    jQuery way: Pass the checkBoxes objects to this function please, e.g.

    //
    function OnSelect( checkBox3, checkBox1, checkBox2 )
    {
    if( checkBox3.is( ':selected' ) )
    {
    checkBox1.attr( 'disabled', false );
    checkBox2.attr( 'disabled', false );
    }
    else
    {
    checkBox1.attr( 'disabled', true);
    checkBox2.attr( 'disabled', true);
    }
    }

    Happy coding, Morgs

    ASP.NET question java tools

  • Open a pdf file in browser
    M Morgs Morgan

    Have you tried my solution? when you click the link, the browser will open the pdf file for you in the browser, if the browser does not know how to open your file, it will offer it for download. e.g. http://www.edb.utexas.edu/minliu/multimedia/CSS.pdf[^] I don't think you are going to find any other way around this, oh well you can always try something after one thing fails. Happy coding, Morgs

    ASP.NET tutorial

  • How to crypt my URL
    M Morgs Morgan

    There are many ways you can escape such a not too cool practice. 1. Put your parameters in a separate session object and access it on the other page, e.g.

    Session[ "UserName" ] = "toto";
    Session[ "UserEmail" ] = "toto@yahoo.fr";
    Session[ "UserPassword" ] = "totototo";

    //redirect to your page like so:
    Response.Redirect( "subscribe.aspx?From=LoginUser" );

    Go here and find out more of this stuff: http://msdn.microsoft.com/en-us/library/ms178581.aspx[^] 2. Put your parameters in a separate cookie object and access it on the other page, e.g.

    Response.Cookie[ "UserName" ].Value = "toto";
    Response.Cookie[ "UserEmail" ].Value = "toto@yahoo.fr";
    Response.Cookie[ "UserPassword" ].Value = "totototo";

    Go here and find out more of this stuff: http://msdn.microsoft.com/en-us/library/ms178194.aspx[^] 3. Using the handy to manage Cache object: http://msdn.microsoft.com/en-us/library/aa478965.aspx[^] 4. You can keep it as you wanted by encrypting your parameters and you could: a. Convert to base64 http://msdn.microsoft.com/en-us/library/dhx0d524.aspx[^] b. MD5 hash http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx[^] But again, you don't want to put sensitive information in your url as people can decode it, which is why i would recommend the first 3 options. Happy coding, Morgs

    ASP.NET dotnet tutorial question

  • to retrieve userid & name
    M Morgs Morgan

    You already have the idea of using query string to pass your parameters to the next page and all you could have done is googled how to use query string, let's see if this helps:

    //pass the parameters like so:
    Response.Redirect( "home.aspx?userid=" + userid.Text + "&name=" + name.Text() )

    and on home.aspx page load event you can retrieve your parameters from the query string like so:

    if( Request.QueryString[ "userid" ] != null && Request.QueryString[ "name" ] != null )
    {
    String userid = Request.QueryString[ "userid" ];
    String name = Request.QueryString[ "name" ];
    }
    else
    {
    //the query strings do not exist/were not passed
    }

    Want more: Passing variables between pages using QueryString[^] Happy coding, Morgs

    ASP.NET asp-net database help question

  • Open a pdf file in browser
    M Morgs Morgan

    You clients browser will decide whether or not to open the pdf file or offer a download functionality, but hey! here goes the answer:

    Download file

    Caution here! It's never a good idea (security large hole) to offer a full file path like you have done in the orginal post which is why i changed it in my solution. Happy coding, morgs

    ASP.NET tutorial

  • Javascript and Dates
    M Morgs Morgan

    You can use the more accurare way,

    var date = new Date(d1);

    //get your date components like so:
    var day = date.getDay();
    var month = date.getMonth();
    var year = date.getYear();

    See link here: - http://www.w3schools.com/js/js_obj_date.asp[^] Happy coding, Morgs

    JavaScript question javascript tutorial

  • class
    M Morgs Morgan

    //assuming your class name is called "Users"
    List users = new List();
    Users user = new Users();
    user.UserId = 1;//assuming the id is of type "int"
    user.Name = "Byka";//assuming this is indeed the user name
    users.Add( user );//we are adding an instance of the User class

    You can do this in a for/foreach loop if you are reading the users from the database. if that's the case, you can go

    List users = new List();
    for(int i=0;i

    Happy coding,
    Morgs

    ASP.NET question

  • Design Problem in IE6
    M Morgs Morgan

    :thumbsup:

    Web Development help design question

  • changing size of web page
    M Morgs Morgan

    Hi there, I like your intention that you would like to manually change website size after knowing the user's screen dimensions, but hey! that is simply a waste of time and might make u write 1000s lines of code which might actually not work on every computer. A properly designed website will at most resize itself when rendered by a browser. Mostly all you need is to set the width of the outter content (div) to say: width:960px; Don't set the height, let the browser decide how much your web page will grow downwards. Honestly speaking, it's messy to rely on your clients resolution to determin your page display layout. In my designing, i just design one site with one set dimension and that's it! the rest will sort itself on client-side without any javascript/jQuery involved. Happy designing, Morgs

    JavaScript javascript help question

  • formatting in source view
    M Morgs Morgan

    I answered this in your previous post below. Hope you are sorted otherwise just give a shout! Morgs

    ASP.NET csharp asp-net question workspace

  • C# asp.et web form
    M Morgs Morgan

    Hi, It looks to me that you admit when you drag and drop controls from design view onto your page out of HUMAN ERROR you are dropping the controls onto a wrong place/point/spot! YEs i hear you there, you can make such a mistake which as you mentioned is messing with your entire layout. Again you mentioned that if you do the same process in source view you are dropping the controls at the right spot, that's it! you are going to start using source view to design your web pages/forms because that's what is easier for you, and for most of us i guess... Besides there's a 50% chance that the page design you see in design view won't be the page design you will see when opened in a webbrowser(i.e IE or firefox). In my projects i use source view to create my design and a browser to see my work done so far, i don't remember using design view. ..And like Mark mentioned, try and avoid tables to design your pages. This is old and designers have decided to leave tables alone only if you really need it then you can use tables otherwise try the magic and power of DIV (page division), this element shipped with CSS[^] can start and finish a page design :) Happy coding, Morgs

    ASP.NET csharp asp-net hardware regex tutorial

  • alignment of controls
    M Morgs Morgan

    Hi, Nowadays to get a best web page layout that is not only easy to render on client side but also easier to design, is to actually avoid tables and use something like divs (or

    ). This element can align your entire page like magic! As you can see in my example i have put in place a simple but yet handy attribute to the div, "style". The style attribute will help you style your div (oh div stands for "division", a division on your page), and for the sake of alignment in my example i have put float:left, you could also have float:right or simply don't put the float and the browser will decide where to place your division(s) when rendered. There are many styles you can put such as margin, padding, text-align, background, color....and much more! This comes with the power and magic of CSS! Get a hard start on this topic, css: http://www.csstutorial.net/[^] This all you need to giveup tables on your pages. Happy coding, Morgs

    ASP.NET csharp asp-net question html design

  • how to create a download feature in asp,net?
    M Morgs Morgan

    What do you want to download? a pdf, doc, xcel, or image file? Please explain further! To allow users to for instance download a pdf file all you do is:

    Download File

    Whenever a user clicks on this anchor, the browser will open the download window and depending on browser type some will open the file for you and some will ask the user to download. Happy coding, Morgs

    ASP.NET tutorial question

  • click of a button in master page
    M Morgs Morgan

    Perhaps you need to learn a little of ASP.NET here: - http://asp.net-tutorials.com/[^]

    MalarGayu wrote:

    LinkButton

    MalarGayu wrote:

    Set the onclick event of the button and access the onclick from code behind: -Design View

    - Codebehind

    protected void Button1_Click( object sender, EventArgs e )
    {
    //Do everything you want when a user clicks the button below this line.
    }

    ASP.NET help 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