code snippet
Include javascript programmatically using ASP.NET 2.0
The thing is I want to include javascript into the page programmatically mainly because I want to use the full url for the source of the javascript.
So I put these on the code behind during the OnLoad event.
int i = 1;
HtmlGenericControl script = new HtmlGenericControl("script");
script.Attributes.Add("type","text/javascript");
script.Attributes.Add("src",Page.ResolveUrl("~/your url"));
//add after the title tag
Page.Header.AddAt(i++,script);
Generating random number and send to user’s email
Someone asked me about this, here i thought to share with you all. The code is not the perfect, but important thing is the logic behind it.
You can find the snippet below. The logic is like a maybank2u transaction. You request the code, put it in the database with the user id, and send the random number to user’s email. After that, when the user upload the file, with the code, you check the database. that one in another script after you send the file to upload.
You need to have your php server configured with mail function, else it won’t work.
Search
Blogroll
My Bluray
My PC
My PC Games
My PC Games Wish List
My Playstation Games
- Crisis Core
- Dead Space
- Final Fantasy X International (Ultimate Hits)
- God of War
- God of War II
- Metal Gear Solid 2: Substance (Konami Palace Selection)
- Metal Gear Solid 4: Guns of the Patriots [Special Edition]
- Shin Onimusha: Dawn of Dreams (PlayStation2 the Best Reprint)
- Star Wars The Force Unleashed


