Wednesday, April 23, 2008

PASSING VALUES THROUGH PAGES

Inorder to get requsted values from one page to another,programmers do much things.
Now i'll tell you an interesting part of passing of value.
Either how to do that correctly and easly.

Response.Redirect("Default2.aspx?name=" + TextBox1.Text.ToString());

Actualy this is the default page's code,its shows that the click in Default page must get the user to Default2.aspx.
And it must keep the value of that which the user entering in a Textbox in Default page.
*This sort of program is using for intenet banking and money transactions.
To do this we must input codes for encryption also.That we'll discuss later.

Ok
After that Deafult page code
move towards Default2.aspx.

Label1.Text = Request.QueryString["name"].ToString();

Here i am storing the value to a label control

That's it.
Hope you enjoyed.
Send me your replys

DATABASE OPERATION

Now ,for this time only ,i will tell you about a c# application working with MS Access instead of SQL server.

For that you must call the namespace "system.data.oledb" first.
Then you can easly connect your application with MS access.

Keep this script with you.Send me your reply on this


namespace access
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
OleDbConnection cnn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\data1.mdb");
cnn.Open();
OleDbDataAdapter ad = new OleDbDataAdapter("select *from employee",cnn);
cnn.Close();
DataTable dt = new DataTable();
ad.Fill(dt);
dataGridView1.DataSource = dt;



}


Here you can see , I am calling the namespace and making the string which carries the path to our database.As always then create a connection,open it.Make an instance of adapter , then merge adapter's source to a datatable .Atlast store that value to an instane of Datagridview .There you are ,you'll now have your data on your page.


Next time same project will be in SQL SERVER.
Feel free to ask doubts.

Master Pages in ASP.net(Helpful for beginers)



A professional web site will have a standardized look across all pages. For example, one popular layout type places a navigation menu on the left side of the page, a copyright on the bottom, and content in the middle. It can be difficult to maintain a standard look if you must always put the common pieces in place with every webform you build. In ASP.NET 2.0, master pages will make the job easier. You’ll only need to write the common pieces once - in the master page. A master page can serve as a template for one or more web forms. Each ASPX web form only needs to define the content unique to itself, and this content will plug into specified areas of the master page layout.



CONFIGURING MASTERPAGES
----------------------------------


To add a master page to a web project, right-click your web project in the Solution Explorer window, select Add New Item, and select the Master Page item type from the Add New Item dialog. The listing below shows a sample master page in source view.

A master page looks very similar to an ASPX file, except a master page will have a .master file extension instead of a .aspx extension, and uses an @ Master directive instead of an @ Page directive at the top. Master pages will define the html, head, body, and form, tags. A new control, the ContentPlaceHolder control also appears in our master page. You can have one or more ContentPlaceHolder controls in a master page. ContentPlaceHolder controls are where we want our ASPX web forms to place their content.

Just like any ASPX form, our master page can contain code in a script block, or in a code-behind file, and can respond to page lifecycle events. The MasterPage class (from the System.Web.UI namespace) derives from UserControl and will have all of the usual events: Init, Load, PreRender, etc. The following listing shows how we’ve added a Page_Load event handler to modify the color of the menu control on the page, and we’ve also added a property to allow setting and retrieving the text inside the footer.



Master Pages and Configuration

---------------------------------------------

There are three ways to associate a web form with a master page. You can use the Master attribute in the @ Page directive, and you can write to the MasterPageFile property in the PreInit event or earlier. We’ve seen examples of both of these techniques. Any web form using the Master attribute of the @ Page directive or setting the MasterPageFile property programmatically will override the web.config settings.

Click me for more




c# universal

Using with DirectSound oversight_failure 23:22 23 Feb '05

Hi. This is some really helpful code, but I'm trying to implement it using DirectSound and hitting a roadblock.

Basically, I have a SecondaryBuffer with its built in DirectX effects. In addition, I'd like to be able to have my own custom effects thrown into the mix. I had no trouble converting the FX frame stuff and effects code so they compile with DirectSound instead of your WaveLib, but the process function uses a buffer and processes it with the effect. From what I can see, the SecondaryBuffer has no way of giving me the raw buffer it's using. There is a read function that isn't very well documented, but I'm not sure if that's what I want. Essentially I need to process the buffer with my own effects when the buffer's "Play" method is called. It's easy to add built in DirectX effects into the effects array, but I have no clue how to stick my own in.

Any pointers on processing a SecondaryBuffer would be great. Actually, any tips on implementing my own custom DirectX effects would be awesome.

Thanks!

Tuesday, April 22, 2008

Hyperlink for Repeater

*asp:Hyperlink Id="HyperLink" Runat="server" NavigateURL="< *%#DataBind.Eval(Container.DataItem, "myLink")%* >">< *%#DataBind.Eval(Container.DataItem, "myMenuItem")%* >< */asp:HyperLink>