Active Server Pages Programming (ASP)/Include File, Set Focus In ASP.NET

Advertisement


Question
Thanks again.

As the detail grid gets filled, the length of the form (output) increases. What I want is the length should be fixed, so that in the web form (grid layout), I can place a footer. This can be achieved if the grid has scroll bars. How to display the scroll bars in the grid, so that the length of the form is always the same (just like the way we do in VB6)?

-------------------------
Followup To
Question -
Thanks for your reply.

I have one more question.

In asp.net I have a web form which does Sales Data Entry. From this web
form, the data is saved into two tables i.e the tbl_SaleMaster and
tbl_SaleTran. tbl_SaleMaster consists of fields Date, PartyCode, InvoiceNo.  tbl_SaleTran consists of fields ItemCode, Qty, Rate.

Now for the user to enter data, I do not have any problems to save data
in tbl_SaleMaster, since this is achieved by saving data from the
textboxes on the web form. But to save data into tbl_SaleTran, I want to
save this data from an object like unbound MshFlexgrid like the way I am
doing in VB6. In asp.net Datagrid object is there, but I am looking out
for MshFlexgrid which has scroll bars (so that the web form size remains the same even if many rows are filled into the grid). Once many rows (all items for this Invoice) are entered by the user, then I intend to save this data at once into the respestive data tables. This is to avoid repeative transactions to the server.

How to achieve this. Please help.


-------------------------
Followup To
Question -
Hi,

I am basically a VB6 programmer since last 5 years. I did some study on classic asp for a month only. Now I want to move on to asp.net instead of classic asp. I have some doubts. Please help.

1) In asp.net how do we include file, just as it is done in classic asp? I want to include 2 files in all my pages (Header & Footer) so that when ever there is a change in the header of footer, I need not change it in all pages.

2) I have many textboxes with a few buttons on a web form. When I click on "Enter" key on one textbox, the cursor should be focused on to the second textbox. Note : It should not post the page and scripting should be on the client side. Since I do not have knowledge of javascript, please send me the code to do this in vbscript.

3) I have found msdn help which comes with Visual Studio.Net very confusing. They do not provide examples. Please tell me few good sites where I can find many examples. I am basically interested in developing database softwares for the web (like Inventory management, Financial Accounting, etc. I have already done this in VB6)
Answer -
Hi

Sorry for the delay...

1.  You need to create User controls and register those in your asp.net pages and call it where ever you need. Check this link gives you step by step instruction how to create custom user control and call in any page. http://www.15seconds.com/issue/020319.htm

2.  I saw somewhere a javascript does that, If i find any i'll pass it to you.

3.  goto Learnasp.com you will get lot of tutorials and sample codes.

Happy Programming!!

-srini

Answer -
Hi

You can use Master Detail ASP.NET form to solve this issue..

Here is the sample url

http://www.c-sharpcorner.com/asp/Articles/MasterDetailDCHK.asp

if you don't want to do that, you can use for each to retrieve each datagrid Item and update the table.

Happy Programming!!

-Srini  

Answer
hi

Sorry for the delay!

Here is the code which creates the scrollbars in the datagrid

<DIV style="OVERFLOW: auto; WIDTH: 50%; HEIGHT: 200px; TEXT-ALIGN: left">


<asp:datagrid class=ControlTextBox id=DataGrid1 runat="server" CellPadding="4" BackColor="White" BorderWidth="1px" BorderStyle="None" BorderColor="#CCCCCC" Width="100%" ForeColor="Black" GridLines="Horizontal">



<FooterStyle ForeColor="Black" BackColor="#CCCC99"></FooterStyle>



<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#CC3333"></SelectedItemStyle>



<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#333333"></HeaderStyle>



<PagerStyle HorizontalAlign="Right" ForeColor="Black" BackColor="White"></PagerStyle>



</asp:datagrid>


</DIV>


-srini

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.