KaushaL.NET

Tried first video on youtube

Posted by: Kaushal on: June 15, 2009

I give a try with windows live movie maker > http://www.youtube.com/watch?v=QEjTZtQ_oqM

hope you like it (also wish to make you think!)

pooh… is that really u?

Posted by: Kaushal on: May 21, 2009

Just look at what I found from my MCA II Sem CONM book…  :)

This is a mere note to remember for future rather than a blog entry. While I am working on code to download file from server. I write below code:

        {
            int ChunkSize = 10000;
            string sFileFullPath = Server.MapPath("New Text Document.txt");
            System.IO.FileInfo toDownload = new System.IO.FileInfo(sFileFullPath);
            if (System.IO.File.Exists(sFileFullPath))
            {
                Response.Clear();
                using (FileStream iStream = System.IO.File.OpenRead(sFileFullPath))
                {
                    long dataLengthToRead = iStream.Length;
                    Byte[] buffer = new Byte[dataLengthToRead];
                    Response.ContentType = "application/octet-stream";
                    Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
                    while (ChunkSize > 0 && Response.IsClientConnected)
                    {
                        if (ChunkSize > dataLengthToRead)
                        {
                            ChunkSize = int.Parse(dataLengthToRead.ToString());
                        }
                        int lengthRead = iStream.Read(buffer, 0, ChunkSize);
                        Response.OutputStream.Write(buffer, 0, lengthRead);
                        Response.Flush();
                        dataLengthToRead = dataLengthToRead - lengthRead;
                    }
                }
                Response.Close();
                Response.End();
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(GetType(), "ShowMessage", "<script language='javascript'>alert('No Files Available');</script>");
            }
        }

When I ran the application I found that the file which I need to download was containing spaces in its name like “New Text Document.txt”.

The problem is:

Read More

I am trying to validate textbox for numeric entry, while I added this code to accomplish in page_load event:

textbox.Attributes.Add(“onkeypress”, “return (window.event.keyCode == 45 || window.event.keyCode == 13 || window.event.keyCode == 8 || window.event.keyCode == 9 || window.event.keyCode == 189 || window.event.keyCode == 109 || (window.event.keyCode >= 48 && window.event.keyCode <= 58) )”);

It worked fine in IE7 and IE8, but it didnt work for FF though. A bit googling gave me conclusion that….

Read More

Generally, I would like to blog post any errors that I face duing development. So that it would be helpful to me for my future reference in case I face it again as well as for the sake of any blog readers who may face same error.

Talking about the error “Invalid URI: The hostname could not be parsed error”: This the same and common error I faced previously some times back and which I also stated in my blog entry DotNetNuke – Invalid URI: The hostname could not be parsed

This time I was about to run a DNN application which is configured from my local server to live application server when I faced the same error. I tried the same work-a-round which I stated in my previous blog entry. But, this time that didn’t work even after investing some hrs investigation.

Read More

Issue: Session Auto Expire Earlier in ASP.NET

Posted by: Kaushal on: May 4, 2009

There are possible work-a-round and solution to work upon “session auto expire earlier” issue. Setting SessionTimeOut in web.config would no be enough to have your session persist for the said time or you want it to be.

Here I have found some solution which worked in my case:

Read More

Core ASP.NET Card, Get it Free

Posted by: Kaushal on: May 4, 2009

Core ASP.NET Card

Core ASP.NET: This Refcard summarizes the most commonly used core functions and controls in ASP.NET

Try it! Its free but requires registration.

Read More

Here is another requirement (perhaps a common requirement!) I needed to implement in one of on-going project website application. I needed to generate a PDF file as output from the inputs entered by end-user in a form. On Completing the form, end-user should be able to download a PDF file of what they have given the inputs in the form.

I need to generate PDF file in a given format and force the download dialog to let the user save generated PDF save on their/client machine.

I tried searching any free :) third party dlls which would help me to generate PDF files on-the-fly. Things I tried:

[1] Tried searching almost third party tools/dlls including Siberix PDF Library , PDF Vision .Net etc etc, which are having similar functionality. But not FREE :(

[2] Tried with iTextSharp – Tutorial and PDFsharp – Download PDFsharp Version 1.20 These dlls/libraries are totally free and really interesting to work with. All we need to do is define elements like HTML and add those elements to PDF document object which then finally generated as PDF document. But, this is the problem for me as I am having a huge PDF file needed to generate as output and it would required a loot of time to code for a document by placing line by line cells, TR and TD, Tables and background, Border colors, images etc. and most of all is annoying Texts to be placed in those elements with proper fonts, colors and padding/alignment.

At last after wasting time in googling and on free tools/libraries, I got an idea to create PDF on-the-fly. I was thinking of creating PDF files dynamically and I created it smoothly with out too much work and code.

This is how it goes:

Read More

While working on DNN 5.0 site, I was trying to have a left menu navigation using AJAX Accordion. Even, I got succeeded in implementing that but i come accross an issue of – flickering the Accordion control in  IE while opening and closing and navigating thru panes.

After googling, I came to know about the solution and applied which worked successfully.

Frist is, Turn off FadeTransitions Property, i mean set it to “False”,  :( yes, its the cute effect everybody want to have while using accordion with. But, while I set it to false and removed the TransitionDuration property – The problem of flickering issue got solved. So, everybody speak with me – “I dont want FadeTransition effect :) in DNN with Accordion!”.

Read More…

Cross browser compatibility struggle is getting upsetting while working with asp:Menu Server Control. Anyhow, It was not rendering/working well with Safari and Chrome.

A bit of googling… and I have a solution for this.

I have added below small piece of code snippet in my MasterPage’s Page_Load event

Read More

Victims

  • 38,875 Hits

Calendar

November 2009
M T W T F S S
« Jun    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Archives

KaushaL Parik (Microsoft MVP – ASP.NET)