Finally a dream comes true….
Long back I dreamed about starting a blog in my name and finally it happened
. I invite all of you to visit my new blog at
http://www.rajeeshcv.com
Add comment June 19, 2008
WPF Controls blog
I have started a new blog dedicated to WPF (Windows Presenation Foundation) controls
Please visit http://wpfcontrols.blogspot.com to know more about WPF Controls
The above blog covers list of thirdparty WPFcontrols, WPF Control development tutorials, WPF Video tutorials etc…
1 comment October 21, 2007
Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’
Few days back,I developed an ASP.NET website in .NET 2.0 with SQL Server 2005 as the back end. Everything was working fine in the cassini (web server that comes with VS 2005).
After finishing the project, for the testing purpose I thought of publishing it in the real IIS in my local machine.
All went smoothly
and I was able to view the website locally, but when was I trying to login into the website with the administrator username and password I got something like this “Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’”
For some reasons I couldn’t understand why this is happening…. But after a googling I found that, this is because of the connectionstring that I used in the web.config
If you have created the connectionstring, like below
<add name=”xxxxx” connectionString=”Datasource=servername;Integrated Security=SSPI;initial catalog=xxxx;”
providerName=”System.Data.SqlClient” />
ie you are trying to login into the SQL Server DB using the Integrated Secrity credentials which wrong
So you have to explicitly specifiy the user id and password in the connectionstring, like below,
<add name=”xxxx” connectionString=”Data Source=localhost;Initial Catalog=xxx;user id=[userid];password=[password];” providerName=”System.Data.SqlClient”/>
Hope this will solve your issue
10 comments October 16, 2007
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:
- A rich set of sample controls and extenders that make spicing up your Website with rich functionality a snap. Everything you need to get started is inside including full source code, documentation, and more!
- An easy to use SDK that simplifies the process of writing “Atlas” components.
In the “Atlas” Control Toolkit, you’ll find the following controls and extenders (click the links to see them in action!):
- Accordion Control: Create efficient UI from multiple panes with this animated control.
- AlwaysVisibleControl: Docks a panel to a corner of the browser window and keeps it visible even when the user scrolls.
- CascadingDropDown: Easily link drop downs, complete with asynchronous population and no postbacks!
- CollapsiblePanel: This extender allows panels on your page to collapse and expand with no code.
- ConfirmButton: This extender adds a confirm dialog to any Button, LinkButton, or ImageButton control.
- DragPanel: Makes any panel into an object that you can drag around the page.
- DropShadow: This extender adds attractive drop shadows to any control on the page
- DynamicPopulate: Replace the contents of a page element with the result of a web-service call.
- FilteredTextBox: Restrict the types of input that text boxes will accept.
- HoverMenu: Allows UI to pop up next to a control when the mouse hovers over it.
- ModalPopup: Allows you to show styled modal UI without using HTML dialogs.
- NumericUpDown: Allow users to easily increase and decrease values using the mouse to scroll through values.
- PagingBulletedList: Add paging and sorting to long bulleted lists.
- PasswordStrength: Give your users visual cues to help them create secure passwords.
- PopupControl: This extender turns any panel into a popup.
- Rating: Let your users easily give feedback by rating content with this easy-to-use control.
- ReorderList: This control is a full-featured data-bound control that allows its elements to be reordered on the client via drag and drop.
- ResizableControl: Allow users to dynamically resize content, right in the browser.
- RoundedCorners: Rounds the corners of any control for a clean, professional look!
- TextBoxWatermark: This extender adds “watermark” prompt text to TextBoxes on the page.
- ToggleButton: This extender turns an ASP.NET CheckBox into an image checkbox.
DOWNLOAD the “Atlas” Control Toolkit now!
Add comment August 20, 2006
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.
Add comment August 5, 2006
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
6 comments August 1, 2006
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” />
10 comments July 26, 2006
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
22 comments July 26, 2006
Page post back after JavaScript code executed on server control click
I created a ASP.NET page with two text boxes and a button. I want this button to reset the form(Only to reset the page). There are two ways you can do this, one is going to the click event of the button and add the code to clear the text boxes. Like the one given below
C#
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = string.Empty;
TextBox2.Text = string.Empty;
}
but this technique is very heavy, bcz it need another round trip to the server.
The other way is using the JavaScript. You need to add an attribute to the button in the page load event. Like this
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add(“onclick”, “JavaScript:document.forms[0].reset(); return false;“);
}
what this code does is that, The button is rendered like this
<input type=”submit” name=”Button1″ value=”Button” onclick=”JavaScript:document.forms[0].reset(); return false;” id=”Button1″ />
so that the page wiill be automatically reset when the user clicks the button (Completely handled by the browser, no round trip to the server).
The code that I bolded (return false;), its very important, other wise the page will be posted back.
11 comments July 21, 2006
Maintaining the Scroll Position after post back
Some of us may come across this situation, ie maintaining the scroll position after the page is post back. This is very useful when we have a gridview or data repeater or some thing like that, which shows a large amount of data and a button controls is place below page, so that user has to scroll a bit to reach there. After clicking on the button, the page is posted back, but the page is scrolled to top.
If you want to maintain the scroll position, add this attribute on the @page directive
<%@ Page Language=”VB” MaintainScrollPositionOnPostback=”true”
Hope this will help you
9 comments July 18, 2006