Posts

Showing posts from December, 2006

saving an html file from a code behind - ASP.NET

However if you really need to generate HTML output from an ASPX page it canbe easily done by overriding the Render method and capturing the output from
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter) ' *** Write the HTML into this string builder Dim sb As StringBuilder = New StringBuilder() Dim hWriter As HtmlTextWriter = New HtmlTextWriter(New StringWriter(sb)) MyBase.Render(hWriter) ' *** store to a string Dim PageResult As String = sb.ToString() ' *** Write it back to the server's HTTP Stream -' *** skip this if you don't want to display the rendered content writer.Write(PageResult).... PageResult now hold the HTML content you can write to diskdo whatever you want to with. End Sub This example goes to string but you can use a StreamWriter instead of stringbuilder to dump the output directly to file if you wish.
Same in C#:
protected override void Render(HtmlTextWriter writer)
{
// *** Write the HTML into this string builder
StringBuilder sb = new St…

Looking for commercial use RSS weather feed by zipcode or alternative

Looking for commercial use RSS weather feed by zipcode or alternative

You can get the commercial use RSS from this website

http://www.hamweather.com/rss/

Using NotesSQL ODBC Driver and C# extract the .nsf file data

Using NotesSQL ODBC Driver and C# extract the .nsf file data to XML file format or any other format. NoteSQL ODBC Driver Download Click HereSample Code:public XmlDocument GetFromNSFdb(string strNSFdbName) { Domino.ISession session = new NotesSessionClass(); session.Initialize(""); Domino.NotesDatabase database = session.GetDatabase("", strNSFdbName, false); Domino.NotesNoteCollection noteCollecton = database.CreateNoteCollection(true); noteCollecton.SelectAllAdminNotes(true); noteCollecton.SelectAllCodeElements(true); noteCollecton.SelectAllDataNotes(true); noteCollecton.SelectAllDesignElements(true); noteCollecton.SelectAllFormatElements(true); noteCollecton.SelectAllIndexElements(true); noteCollecton.SelectForms = true; noteCollecton.BuildCollection(); Domino.NotesDXLExporter exporter = (Domino.NotesDXLExporter session.CreateDXLExporter(); string strNsfXML = exporter.Export(noteCollecton); // removes the string strDocrmv = strNsfXML.Replace("", "&q…

Microsoft SecureWar Security Competition for India

Image
Microsoft SecureWar Security Competition

Click Here to participate in this microsoft competition.

get the dimension of my document using JavaScript

to get the dimension of my document.

// javascript
var screen_width = null;
var screen_width = null;
screen_width = document.body.offsetWidth;
alert('Get IT');
screen_height = document.body.offsetHeight;
document.forms[0].txt_width.value = screen_width;
document.forms[0].txt_height.value = screen_height;

But the above script will fire only once the first time when the page is loaded.

do to execute this script every time the user resize window of the browser, use the following code part

if (self.innerWidth)
{
frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth)
{
frameWidth = document.documentElement.clientWidth;
frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight;
}
else return;
if (self.screen.width < frameWidth *2 self.screen.height < frameHeight *2)
{
newWidth = self.screen.width/2;
newHeight …

using ArrayList for Simple Scenario (Using C#)

Scenario:

I have 2 tables one has 6 textboxes, the other has 8 rows with one textbox per row.I need to insert into a table the values in the first 6 textboxesfrom table 1 plus value from textbox 1 row 1 to textbox 8 row 8 in table 2. altogether 8 insert queries, so I will need a for loopthat will attach the values form table 1 to each value in table 2 unless the value is null.can I create an array of texboxes in table 2 so then I could loop through the array?

Solution (Using C#):

//This code to implement
ArrayList list = new ArrayList();
list.Add(new Category("textbox1"),1);
list.Add(new Category("textbox2"),2);
list.Add(new Category("textbox3"),3);
list.Add(new Category("textbox4"),4);
list.Add(new Category("textbox5"),5);
list.Add(new Category("textbox6"),6);
list.Add(new Category("textbox7"),7);
list.Add(new Category("textbox8"),8);

foreach (Category cate in list)
{
try
{
sql = "INSERT INTO DB..tAble (col1, col2) V…

MOSS 2007 Site templates

MOSS 2007 Site templates:MOSS 2007 Site templates we have four category of templates1) Collaboration2) Meetings3) Enterprise4) PublishingCollaboration:Team Site: A site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions. Blank Site: A blank site for you to customize based on your requirements. Document Workspace: A site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document. Wiki Site: A site for a community to brainstorm and share ideas. It provides Web pages that can be quickly edited to record information and then linked together through keywords

Blog: A site for a person or team to post ideas, observations, and expertise that site visitors can comment on.

Meetings

Basic Meeting Workspace: A site …

What is the Ribbon in Office 2007

The Ribbon replaces the current system of layered menus, toolbars, and task panes with a simpler system of interfaces optimized for efficiency and discoverability.

The 2007 release of Office provides two ways to customize the RibbonX UI using XML markup:
Using valid Open XML Formats files that contain XML markup. Using COM add-ins that contain XML markup.

One of the nice article i gone through in the MSDN is ...

Code:
public void OnActionCallback(Office.IRibbonControl control, bool isPressed)
{
if (control.Id == "checkBox1")
{
MessageBox.Show("You clicked " + control.Id);
}
else
{
MessageBox.Show("You clicked a different control.");
}
}

using VSTO for visual studio 2005 we do these kind of C# coding in ribbon or add-on development for office 2007.

Demo Video for VSTO 2005 -- Visual Studio 2005 Tools for the 2007 Microsoft Office System

Demo of Visual Studio 2005 Tools for the 2007 Microsoft Office System, Second Edition

Andrew Whitechapel gives a brief demo of the new VSTO 2005 Second Edition in this video, reviewing key developer features such as new default templates, Ribbon customization, creating custom task panes, and more.

Microsoft Visual Studio 2005 Tools for Office Second Edition Runtime (VSTO 2005 SE) (x86)

The Microsoft Visual Studio 2005 Tools for Office Second Edition (VSTO 2005 SE) redistributable package installs the Visual Studio Tools for Office runtime, which is required to run solutions built using VSTO 2005 or VSTO 2005 SE.

http://www.microsoft.com/downloads/details.aspx?familyid=f5539a90-dc41-4792-8ef8-f4de62ff1e81&displaylang=en

The Microsoft Visual Studio 2005 Tools for Office Second Edition (VSTO 2005 SE) redistributable package installs the Visual Studio Tools for Office runtime, which is required to run solutions built using VSTO 2005 or VSTO 2005 SE. This runtime supports solutions built for Microsoft Office 2003 or the 2007 Microsoft Office system.For information about Visual Studio 2005 Tools for Office Second Edition, see the Microsoft Office Developer Center.

Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System

Install VSTO 2005 SE to create new application-level add-ins for six applications in the 2007 Microsoft Office system and five in Microsoft Office 2003. Use managed code to customize task panes and the Ribbon in the 2007 Microsoft Office system applications.

http://www.microsoft.com/downloads/details.aspx?FamilyId=5E86CAB3-6FD6-4955-B979-E1676DB6B3CB&displaylang=en

VSTO 2005 SE includes support for Microsoft Office InfoPath 2007 form template projects, previously available as a separate product known as the Microsoft Office InfoPath 2003 Toolkit for Visual Studio 2005. You can now design InfoPath 2007 form solutions right in the Visual Studio 2005 environment if you have InfoPath 2007 installed on your computer.

For more click here

November 2006 Winner - 9th position

Image
November 2006 Winner - 9th position @ Community-Credit.com

Microsoft presents the “Microsoft BlogStars” contest

Microsoft presents the “Microsoft BlogStars” contest – hunt for the best developer bloggers in India.Create greater impact in the vibrant developer blogger community, showcase your thoughts and experiences around Microsoft technologies and technology in general.Register for the contest, start BLOGGING! and be the first ever Microsoft Blogstars!

http://www.microsoft.com/india/blogstars/Note: Currently registration is closed

One among the top 10 member in November 2006 @ Community-Credit.com

Image