29 April 2008
02 April 2008


Using MSDN Reader we can brows MSDN Magazine very easily.
This is available on WidowsClient.net


Download MSDN Reader
04 March 2008


Now there is a functionality to "Print This Page", but not full page only one table form that. and it's value comes form database.
There is one want to open a page and load that same information form database. but using javascript, it's become so easier.
Let's check...

you can see that, there is some content with master page, Now I just want to print detail page, but not master page.
so I need to give ID to that control which one I want to print,
for example:
table id="tblResult"
and right down some javascript into this page.
script language="javascript">
function OpenWindow()
{
var printContent = document.getElementById("tblPrint");
var sFeatures = "height=200,width=300,status=no,toolbar=no,menubar=no,location=no";
win = window.open("","Print", sFeatures);
win.document.write(printContent.innerHTML);
win.document.close();
win.focus();
win.print();
win.close();
}
script>
Now, right down onClick event = " OpenWindow()" in button.
Finally you click on "Print" button, It will open a new popup window and it will see also open a print dialogbox.

getElementById(IDName).innerHTML will do this job.
Now Visual Studio 2008 have small name of "getElementById" and that is "$get".
23 February 2008


It will display Gurati language keyborad and search result in Internet Explorer.

14 February 2008


"Browse with" menu is use to browse our web page in particular selected browser.
Right click on solution explorer, on "aspx" page.

This is "Browse with" dialog box.

Select the browser name and "Set as Default" to open every time your web site in the same browser.
You can also set bowser resolution (window size) by clicking on bellow drop down.

And there is another small one feature "Internal Web Browser", here will browser your site in you IDE directly.

12 February 2008


Just 4 steps of code for this!
1) Declare event in the user control
public EventHandler AddNew;
2) Fire that event form user controls event.
if (AddNew != null)
AddNew(sender, e);
(like button click event in that control.)
3) Now asign that event in Page_OnInit event for that control.
protected override void OnInit(EventArgs e)
{
myUserCotrol1.AddNew = new EventHandler(MyNewEventMethod);
}
protected void MyNewEventMethod (object sender, EventArgs e)
{
//Some code;
//Some code;
}
31 January 2008





Create PROCEDURE usp_MoveSequence]
@ID int,
@Sequence int,
@MoveBy varChar(4)
AS
BEGIN—PROCEDURE
SET NOCOUNT ON;
DECLARE @compateTo INT
DECLARE @compateToMax INT
DECLARE @currentSequence INT
DECLARE @NextSequence INT
DECLARE @NextRecordID INT
IF @MoveBy='UP'
Select TOP 1 @NextSequence=Sequence, @NextRecordID=ID from TableName where sequence<@Sequence ORDER BY sequence DESC
ELSE IF @MoveBy='DOWN'
Select TOP 1 @NextSequence=Sequence, @NextRecordID=ID from TableName where sequence>@Sequence ORDER BY sequence
--ENDIF
IF @NextRecordID<>0
BEGIN
UPDATE TableName SET Sequence=@NextSequence WHERE ID=@ID
UPDATE TableName SET Sequence=@Sequence WHERE ID=@NextRecordID
END
END--PROCEDURE