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

MihirV

@MihirV
About
Posts
72
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Executing JavaScript on asp:button_click event
    M MihirV

    Try it using RegisterStartupScript(Type, string, string), it will work as per ur expectation. :)


    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET javascript tools

  • How to expire previous page?
    M MihirV

    Hi there, Write the following header settings in Page Load event, Page will always rendered from the server rather than from cache... and displays a message stating that page is expired.

    Response.AddHeader ("Pragma", "no-cache");
    Response.Cache.SetCacheability (HttpCacheability.NoCache);
    Response.Cache.SetExpires (DateTime.Now.AddHours (-1));
    

    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET csharp question asp-net help tutorial

  • Help for implementing interface
    M MihirV

    hi there, more appropriate solution is as follows

    Private Sub IncrementObject(INumber incrementor)
      incrementor.Increment()
    End Sub
    Public Shared Sub Main()
      Dim s As New Sequential()
      Dim n As New Numeric()
      ''
      '' This will execute Increment logic of Sequential Class
      IncrementObject(s);
      ''
      '' This will execute Increment logic of Numeric Class
      IncrementObject(n);
    End Sub
    

    Above method accepts object of type INumber, so any number of classes in which you implement INumber interface can be passed as argument in this method and this method will execute appropriate logic of increment, Instance of Sequential Type will execute its own increment method.


    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET help question

  • Help for implementing interface
    M MihirV

    hi there, Review the following code i hope this will help you.

    Private Sub IncrementObject(Object obj)
      Dim incrementor As MyInterface
      incrementor = CType(obj, MyInterface)
      incrementor.increment()
    End Sub
    
    Private Sub Main()
      Dim class1 As New MyClass1
      Dim class2 As New MyClass2
      Dim class3 As New MyClass3
    
      IncrementObject(class1)
      IncrementObject(class2)
      IncrementObject(class3)
    End Sub
    

    :)


    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET help question

  • Custom Control post back raises Validation Control's Validate event
    M MihirV

    Hi all, I have developed a custom pager control, which has been inherited from WebControl, IPostBackDataHandler. Function of the control is to render a pager layout ( page numbers, next, prev, buttons ) and raise an event on the server when page change in UI. Problem is what when i place any validator control which are validate on server only are raising validation on custom pager control's post back. code preview

    PreRender(){
       // Registering client script block that set page index in hidden
       // and submit the form
    }
    
    Render(){
       // Rendering set of links (  ) that will call my javascript function
       // to set page index in hidden and post back the page
    }
    
    LoadPostData(){
       // Check hidden variable and return true to raise event
    }
    
    RaisePostDataChangedEvent(){
       // Raising PageIndexChanged event
    }
    

    if anybody has resolution of this problem, please guide me, i will be very thankful to all of you.


    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET javascript database design sysadmin tools

  • Custom Control post back raises Validation Control's Validate event
    M MihirV

    Hi all, I have developed a custom pager control, which has been inherited from WebControl, IPostBackDataHandler. Function of the control is to render a pager layout ( page numbers, next, prev, buttons ) and raise an event on the server when page change in UI. Problem is what when i place any validator control which are validate on server only are raising validation on custom pager control's post back. :confused: code preview

    PreRender(){
       // Registering client script block that set page index in hidden
       // and submit the form
    }
    
    Render(){
       // Rendering set of links (  ) that will call my javascript function
       // to set page index in hidden and post back the page
    }
    
    LoadPostData(){
       // Check hidden variable and return true to raise event
    }
    
    RaisePostDataChangedEvent(){
       // Raising PageIndexChanged event
    }
    

    if anybody has resolution of this problem, please guide me, i will be very thankful to all of you.


    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET javascript database design sysadmin tools

  • SelectedIndexChanged with data bound DropDownList
    M MihirV

    hi there you should bind DropDown control like this...

    meetingDateDdl.DataSource = room.Meetings;
    meetingDateDdl.DataTextField = "MeetingID";
    meetingDateDdl.DataValueField = "Description";
    meetingDateDdl.DataBind();
    
    //the following line gives u the exact selected MeetingID
    string selectedMeetingID = meetingDateDdl.SelectedValue;
    

    :)


    Confidence comes not from always being right, but from not fearing to be wrong. Mihir..

    ASP.NET database csharp asp-net business help

  • ,how to show 24 hours time format ?
    M MihirV

    hi there, you can convert the database DateTime type to string in your front-end code like follows string sDate = dbDate.ToString( "dd/MM/yyyy HH:mm" ); will returns time in 24 hours format :) Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET database csharp asp-net tutorial question

  • Sending File to Clients
    M MihirV

    hi samy, you can replace the file path with yours but make sure that your folder must have rights(atleast Read) to the ASPNET machine user.

    string sFilePath = "c:\\inetpub\\wwwroot\\files\\file1.ext";
    

    it will work fine...:) Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET security

  • Counting controls (very urgent)
    M MihirV

    hi, like this,

    int count = 0;
    HtmlForm form = (HtmlForm)this.FindControl( "Form1" );
    
    if( form != null )
       foreach ( Control control in form.Controls )
          if ( control is TextBox )
             count++;
    
    Response.Write( count.ToString() );
    

    :) Confidence comes not from always being right, but from not fearing to be wrong..... Mihir.. -- modified at 0:52 Tuesday 17th January, 2006

    ASP.NET csharp asp-net question

  • Sending File to Clients
    M MihirV

    hi, *ASPNET machine user must have access rights to this file.

    string sFilePath = Server.MapPath( [your file name] );
    
    if ( File.Exists( sFilePath ) )
    {
    Response.Clear();					
    Response.ContentType = "application/" + Path.GetExtension( sFilePath );
    Response.AddHeader( "Content-Disposition", "attachment; filename=\"" +    Path.GetFileName( sFilePath ) + "\"" );
    Response.Flush();
    Response.WriteFile( sFilePath );
    Response.End();
    }
    

    :) Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET security

  • variable Hyperlink in datagrid
    M MihirV

    hi there try this

    <asp:HyperLinkColumn DataNavigateUrlField="prod_num" DataNavigateUrlFormatString="cardinfo.php?prodnum={0}"
    DataTextField="sku" HeaderText="SKU"></asp:HyperLinkColumn>
    
    ASP.NET php docker help question

  • File access problem
    M MihirV

    thanks to both.. i have solved the problem.. problem was with SmartNavigation property of the page, i dont know why it is happening. i had set this property to True. By restoring the default value problem has solved. Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET help asp-net

  • File access problem
    M MihirV

    hi all i have problem in file IO, if one of you can solve the problem i will very thank full to him/her... Description: i hv one page that enables the user to upload file, for that i use HttpInputFile control to receive posted file by user. i can save posted file but i can not delete that posted file, it is throwing an Exception "System.IO.IOException: The process cannot access the file ". another process 'aspnet_wp.exe' is accessing the same file. Code:

    void SaveFile()
    {
    filInput.PostedFile.SaveAs(filename);
    //Validation code to check the file whether it is valid or not
    //if invliad delete the file and show message
    File.Delete(filename); // Error line
    }
    

    Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET help asp-net

  • File download problem in netscape
    M MihirV

    hi all, i have a page that enables site user to download report files from the server. report file types are .pdf, .doc, .ppt and .xls for that what i am doing is creating a Stream from file and convert it into the byte and binary write the output... so it is working fine in IE but while using netscape, the download dialog concat the file name with .aspx ( fileName.pdf.aspx ), so netscape can not open the file with proper application.. any solution please help me, thanks in advance here i m giving my code for depth review the problem

    if ( File.Exists( sPathName ) )
    {
    using( FileStream oFStream = new FileStream( sPathName, FileMode.Open ) )
    {
    iFileLength = (int)oFStream.Length;
    buffer = new byte[iFileLength];					
    oFStream.Read( buffer, 0, iFileLength );
    oFStream.Close();
    }
    
    Response.Buffer = true;
    Response.Clear();					
    Response.ContentType = "application/" + Path.GetExtension( sPathName ).Remove(0, 1);
    
    Response.AddHeader( "Content-Type", "application/octet-stream" );
    Response.AddHeader( "Content-Length", iFileLength.ToString() ); 
    Response.AddHeader( "Content-Disposition", "attachment; filename=\"" + Path.GetFileName( sPathName ) + "\"; Size=" + iFileLength.ToString());
    
    Response.BinaryWrite( buffer );
    Response.Flush();
    }
    

    Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET help sysadmin

  • File download problem
    M MihirV

    hi all, i have a page that enables site user to download report files from the server. report file types are .pdf, .doc, .ppt and .xls for that what i am doing is creating a Stream from file and convert it into the byte and binary write the output... so it is working fine in IE but while using netscape, the download dialog concat the file name with .aspx ( fileName.pdf.aspx ), so netscape can not open the file with proper application.. any solution please help me, thanks in advance here i m giving my code for depth review the problem

    if ( File.Exists( sPathName ) )
    {
    using( FileStream oFStream = new FileStream( sPathName, FileMode.Open ) )
    {
    iFileLength = (int)oFStream.Length;
    buffer = new byte[iFileLength];					
    oFStream.Read( buffer, 0, iFileLength );
    oFStream.Close();
    }
    
    Response.Buffer = true;
    Response.Clear();					
    Response.ContentType = "application/" + Path.GetExtension( sPathName ).Remove(0, 1);
    
    Response.AddHeader( "Content-Type", "application/octet-stream" );
    Response.AddHeader( "Content-Length", iFileLength.ToString() ); 
    Response.AddHeader( "Content-Disposition", "attachment; filename=\"" + Path.GetFileName( sPathName ) + "\"; Size=" + iFileLength.ToString());
    
    Response.BinaryWrite( buffer );
    Response.Flush();
    }
    

    Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET help sysadmin

  • Datagrid view problem:the horizontal scrollbars appears at screen resolution of 800 by 600 pixels
    M MihirV

    hi there you should set width of the datagrid to 100% will solve ur prob. :) Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET help

  • Dynamically Load Content ?
    M MihirV

    hi there use Panel Control instead.... :) Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET question csharp html asp-net winforms

  • detect Javascript enable??
    M MihirV

    hi all, how do i detect that javascript is enabled on the client's browser or not? thanks in advance Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET question javascript

  • DateTime Validation
    M MihirV

    hi all, i have a TextBox control for DateTime input on the Page. i have multiple check on this DateTime control. Like... -Not Null -Valid DateTime -must be greater than some another DateTime -Others also in ASP.Net we have different Validation control to solve it. but i am using CustomValidater to check in one go. i am not understanding how to check DateTime whether it is a valid string or not. if anybody has idea please tell me... Except **try-catch(FormatException)** thanks in advance Confidence comes not from always being right, but from not fearing to be wrong..... Mihir..

    ASP.NET csharp asp-net 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