Thursday, August 31, 2006

 

Moved to a new location

this blog has been moved to a new location http://technology.plugai.info

Sunday, August 20, 2006

 

Adsense : How to make adsense appear on the blogger beta

I was creating a blog in the new blogger beta. And I really loved the Drag-and-drop page elements. So when I tried to add google adsense code to the HTML/JavaScript page element, the ads are not appearing in the blog. I googled it to find an work around, but no hope. But now I have found a way to make this work, this is "Rajeesh's way of showing adsense" :)

Ok I will explain, Below is the code that generated by the adsense tool.


<script type="text/javascript"><!--
google_ad_client = "XXXXX";
google_ad_width = xxx;
google_ad_height = xx;
google_ad_format = "xxxx";
google_ad_type = "text";
google_ad_channel ="xxxx";
google_color_border = "xxx";
google_color_bg = "xxx";
google_color_link = "xxx";
google_color_text = "xxx";
google_color_url = "xxx";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>



what you have to do is that, remove the commenting code that is <-- and //-->
So the new code look like this,

<script type="text/javascript">
google_ad_client = "XXXXX";
google_ad_width = xxx;
google_ad_height = xx;
google_ad_format = "xxxx";
google_ad_type = "text";
google_ad_channel ="xxxx";
google_color_border = "xxx";
google_color_bg = "xxx";
google_color_link = "xxx";
google_color_text = "xxx";
google_color_url = "xxx";
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


Now what you have to do is, paste the changed code inside the content section of the HTML/JavaScript Page element.

You can view the demo here(keralastyle.blogspot.com)

Saturday, August 19, 2006

 

ATLAS : The “Atlas” Control Toolkit helps you bring your websites to life!






The “Atlas” Control Toolkit is a collection of samples and components that makes it easier then ever to build and consume rich client-side “Atlas” controls and extenders. The toolkit provides both ready to go samples and a powerful SDK to simplify the creation and re-use of your own custom controls and extenders.

Inside the toolkit you will find:

In the “Atlas” Control Toolkit, you’ll find the following controls and extenders (click the links to see them in action!):

DOWNLOAD the “Atlas” Control Toolkit now!


Saturday, August 05, 2006

 

ATLAS : Loading Gif Animations

I was sniffing around for some nifty loading gif’s for one of my projects when I found Ajaxload, a drive-thru Ajax-powered site that spits out loading gif animations to your liking on-the-fly. for graphically-challenged Web 2.0 geeks out there, this is the place to go if you want your apps to look cool while they’re pretending to load something.

Tuesday, August 01, 2006

 

MySql : Inserting Unicode characters into MySql using Stored Procedures

Inseting data using stored procedure are very easy, but consider a situation where you have table that contain fields with utf8 character set.

Table something like this

CREATE TABLE `tblperson` (
`Id` int(11) NOT NULL auto_increment, `pname` varchar(255) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

If you use your simple insert procedure like the one below

CREATE PROCEDURE `P_updateperson`(
IN ppName VARCHAR(255))
NOT DETERMINISTIC
SQL SECURITY DEFINER
COMMENT ‘’
BEGIN

insert into `tblperson`(
pName
)
values (ppName);

END;

This won’t work, it will insert the data but not in correct format. So in order to work this, you have to rewrite the stored procedure like this.

CREATE PROCEDURE `P_updateperson`(
IN ppName VARCHAR(255) charset utf8)
NOT DETERMINISTIC
SQL SECURITY DEFINER
COMMENT ‘’
BEGIN

insert into `tblperson`(
pName
)
values (convert(ppName using utf8));

END;

Hope this tip will save a day for you


Wednesday, July 26, 2006

 

Asp.NET : Error : A potentially dangerous Request.Form value was detected from the client

This occurs when we try to post html code. The server will validate the postdata, if it find that its an HTML code, error something similar to this is shown. This actually helps to prevent running malicious script. If you really want to post the html content add this to the page directive validateRequest=”false”.

You can also do this from the web.config like this

<pages validateRequest=”false” />


Tuesday, July 25, 2006

 

Asp.NET : Nested Gridview to show Master/Details relationship in ASP.NET 2.0

This will help you to nest grdiviews inside ASP.NET. There may be many ways to do this, but this is my way( May not be the best, let me know if you have any other ).


1. First drop a gridview in to the page, also set its DataKeyNames to your primary key


2. Add a new template column to this gridview.


3. Place another gridview inside this template column.


the code for the termplate column may look like this


<asp:TemplateField HeaderText=”Heading”>

<EditItemTemplate>

<asp:TextBox ID=”TextBox3″ runat=”server”></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:GridView ID=”GridView1″ runat=”server” DataSource=’<%# GetTrasnl(Convert.ToInt32(Eval(”pId”))) %>’ AutoGenerateColumns=”False” CellPadding=”4″ ForeColor=”Black” GridLines=”Vertical” BackColor=”White” BorderColor=”#DEDFDE” BorderStyle=”None” BorderWidth=”1px”>

<FooterStyle BackColor=”#CCCC99″ />

<Columns>

<asp:BoundField DataField=”language” HeaderText=”Language” />

<asp:BoundField DataField=”uName” HeaderText=”Translator” />

</Columns>

<RowStyle BackColor=”#F7F7DE” />

<SelectedRowStyle BackColor=”#CE5D5A” Font-Bold=”True” ForeColor=”White” />

<PagerStyle BackColor=”#F7F7DE” ForeColor=”Black” HorizontalAlign=”Right” />

<HeaderStyle BackColor=”#6B696B” Font-Bold=”True” ForeColor=”White” />

<AlternatingRowStyle BackColor=”White” />

</asp:GridView>

</ItemTemplate>

</asp:TemplateField>


This child gridview has to show the content based on the primary of the row thats binded to main gridview.


Here in my case “pId” is the primary key. The nesting happens here


<asp:GridView ID=”GridView1″ runat=”server” DataSource=’<%#GetTrasnl(Convert.ToInt32(Eval(”pId”))) %>’


what I have done is that, I have called function “GetTrasnl” and passed the primary key to that function. This function will return a datatable. So each time a row is bound to the main gridview, the child gridview is also bound with the corresponding values.


The functions is like this


Public Function GetTrasnl(ByVal prgId As Integer) As DataTable


………………

……………….


End Function


Please post your comments if you have any


This page is powered by Blogger. Isn't yours?