December 2007 - Posts
I have been working a little bit with Adobe Flex Builder to create flex applications. I really found the UI very rich and lots of functionalities can be developed using flex. Most powerful feature i used is to allow the .NET webservice to communicate with my flex application. As i'm a .NET developer, i used the power of webservices to retrieve data from SQL in which this webmethod will be called from my flex application and display the data in a flex grid.
After you finish building the flex application, you will realize that an html file is created which embeds the swf file. The nice thing about flex application is it can be hosted under IIS. So first create a virtual directory in IIS and map it to your flex application. Now you can access it for example like (http://localhost/Flex/Inbox.html).
In your .NET web application now you can create an iframe, set its source to the location of your flex application (Easy Right?) that's all you need to implement this integration between these two technologies
Below is the HTML code
<iframe src="http://localhost/Flex/Inbox.html" width="50%" height="50%"/>
Another way to do it, is to put the swf file generated by Flex inside your application folder and in your HTML code add an Object tag set its source to the switch file (swf).
HC
Dears,
I just want to share with you an excellent article on msdn. This article demonstrates different ways of improving an ASP.NET application performance.
http://msdn2.microsoft.com/en-us/library/ms998549.aspx
Happy Holidays & Happy Coding
After i got the second prize on dotnetslackers contest, i finally got to try ANTS profiler. Before this time, i never thought i could use such products to know how my application is performing but after the first try i found it VERY useful. It helped me see which functions are taking the longest time to execute plus more functionality. for more information about this product check below link
ANTS Profiler By RedGate
Thank you Sonu for introducing me to Redgate company.
In this blog post, i will explain how to execute javascript function when navigating monthly in the calendar control. As you may know, When the calendar control is rendered to HTML, the ">" and "<" are rendered as anchors HTML control. This is so important to know how to get this control using javascript and add its onclick event handler.
Below is a javascript code to be inserted inside the <head> tag of the HTML page.
<script language="javascript">
function AlertMessage()
{
var elements = document.getElementsByTagName('a');
for(i=0;i<elements.length;i++)
{
if(elements[i].title == "Go to the next month")
{
elements[i].onclick = function(){ alert('Next Month'); return false}
}
if(elements[i].title == "Go to the previous month")
{
elements[i].onclick = function(){ alert('Previous Month'); return false}
}
}
}
</script>
The above code will get all the anchors controls (<a>) inside the body and loop through this collection, check if its title is equal to either "Go to the next month" which is the ">" link or "Go to the previous month" which is the "<" link. when the title match one of these, we set it's onlick event to display just an alert message.Of course you can extend this to achieve whatever functionality you want!!.
Now on page_load event all you have to do is to call that method using
C#:
Page.ClientScript.RegisterStartupScript(this.GetType(), "as", "AlertMessage();", true);
VB.NET:
Page.ClientScript.RegisterStartupScript(me.GetType(), "as", "AlertMessage();", true)
Hope this helps,
Regards,
In this blog post, we will discuss how to create a decremental timer which will redirect the user to another page after 60 seconds. You might have seen this feature in almost every site providing content to be downloaded.
Below is Javascript code to be inserted inside the <head> tag of the HTML.
<script language="javascript">
// Set timer to 60 seconds which will redirect the user to WEbForm1.
window.setTimeout('window.location.href=\"WebForm1.aspx\"',60000);
function Timer()
{
// Call the UpdateLabel Function each second to show the decremental timer to the user
window.setTimeout('UpdateLabel()',1000);
}
function UpdateLabel()
{
// Get the label object
var label = document.getElementById('<%=Label1.ClientID %>');
// Decrease the label value by 1
label.innerHTML = parseInt(label.innerHTML) - parseInt('1');
// Recall this function every 1 seconds.
window.setTimeout('UpdateLabel()',1000);
}
</script>
For Making this sample work, insert a label with id Label1 and text equals to 60.
Hope this Helps,