Thursday, May 25, 2006

Making width and height of ASP:ImageButton to work with Safari and other browsers

If you ever come across the problem of using with specified width and height, it will work fine with the IE but the image dimensions will not be set for other browers like safari, the reason behind it is, whenever you specify the width and height of the it genertaes the Style attribute whenever HTML is rendered and embed the width and height in to it, which works fine in case of IE only.

So what do you need to make it work in each and every web browser. You need to add the width and height attributes to the object using imgBtn.Attribute.add("width","20"), then it will work fine for each and every brower.

Example:

if you have such asp.net code

" asp:imagebutton id="ImageButton1" runat="server" width="50px" height="20px" "

the HTML code generated by it is:

{ input type="image" name="ImageButton1" id="ImageButton1" alt="" border="0" style="height:20px;width:50px;" }

it works fine with IE but not with any other browser

so what needed to be changes, we need to add this

" asp:imagebutton id="ImageButton1" runat="server" "

ImageButton1.Attributes.Add("width","50");
ImageButton1.Attributes.Add("height","20");

now the HTML genertaed will be:

{ input type="image" name="ImageButton1" id="ImageButton1" alt="" border="0" height:20px width:50px }

Enjoy..

Monday, May 08, 2006

ASP.NET: Interview Questions

Hi, These are the typical questions that i usually asks while taking an ASP.NET specific interview. Hope these might help someone :)

*What is View State?
*Can you read the View State?
*What is the difference between encoding and encryption? Which is easy to break?
*Can we disable the view state application wide?
*can we disable it on page wide?
*can we disable it for a control?
*What is provider Model?
*Any idea of Data Access Component provided by Microsoft?
*Any idea of Enterprise library?
*What is web service?
*What is WSDL?
*Can a web service be only developed in asp.ent?
*can we use multiple web services from a single application?
*can we call a web service asynchronously?
*Can a web service be used from a windows application?
*What do we need to deploy a web service?
*What is the significance of web.config?
*Can we have multiple web.config files in a sigle web project?
*Can we have more then one configuration file?
*Type of Authentications?
*Can we have multiple assemblies in a single web project?
*What is GAC?
*What is machine.config?
*What different types of session state Management we have in asp.net?
*What are cookies?
*What is Cache?
*What is AJAX?
*Is AJAX a language?
*What is the difference between syncronus and asyncronus?
*What is an Assembly?
*Can an assembly contains more then one classes?
*What is strong name?
*What is the difference b/w client and server side?
*What we need for the deployment of a asp.net we application?
*what is the purpose of IIS?
*Difference between http and https?
*what is purpose of aspnet_wp.exe ?
*what is an ISAPI filter?
*what do you mean by HTTP Handler?
*What is the purpose of Global.asax?
*What is the significance of Application_Start/Session_Start/Application_Error?
*What is the difference between the inline and code behind?
*what is side by side execution?
*can we have two different versions of dot net frameworks running on the same machine?
*What is CLR? Difference b/w CLR and JVM?
*What is CLI?
*What is CTS?
*What is .resx file meant for?
*Any idea of aspnet_regiis?
*Any idea of ASP NET State Service?
*Crystal report is only used for read only data and reporting purposes?
*We can add a crystal report in aspx page using two techniques, what are these?
*What is the difference between stroed procedure and stored function in SQL?
*Can we have an updateable view in SQL?
*What is connection pooling? how can we acheive that in asp.net?
*What is DataSet?
*What is the difference between typed and untyped dataset?
*What is the difference bewteen accessing the data throgh the dataset and datareader?

Thanks,
Happy Interviewing.


Sunday, May 07, 2006

RSS Puller in ASP

I have created a sample asp page that pulls the data from RSS and displays it on the page, using an XSL fro formatting the output. You just need to change the URL of RSS in:

<%= getXML(" RSS_URL ") %>

Where:

RSS_URL: URL of the RSS whose contents we want to see.

You can change the output of the RSS by updating the XSL file.

ASP RSS Puller