|
|
In your form load complete(it's mean after all process has been done), you can set which checkbox that you want to focus.
For example:
Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoadComplete
If (your condition) Then
chkExample.Focus()
ElseIf (your condition) Then
chkExample2.Focus()
End If
Good Luck..=)
|
|
|
|
|
i have frame.aspx page on which i have frame plus hidden feild.
from which am calling another page.
in that anothe page i want to access hidden feild control of frame.
Below is my design page of frame.aspx
<form id="formFrame" runat="server">
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td align="center" valign="top">
<iframe id="iFrame" name="MainFrame" runat="server" width="940px" height="785px" scrolling="no" frameborder="0" >
</iframe>
<asp:HiddenField ID="hdnCulture" runat="server"/>
</td>
</tr>
</table>
</form>
Below is my frame.aspx.cs code
iFrame.Attributes["src"] = "Default.aspx?ticker=" + sTicker "";
So i want to access hdnCulture control on default.aspx page.
how can i access :(
|
|
|
|
|
Hi,
I need to write a Db2 connection and Need to access physical file in iSeries by using asp.net.
Any url or code?
Guhananth.S
|
|
|
|
|
I have created a web app with 4 layers : Presentation - Business - Services - Data. I have Business.Entities project which is added to Business layer and have Employee class in it.
I also have DataAccess.Entities and Presentation.Entities and have added Employee.cs in there also. Now in project references I have added Presentation project reference in Business, Business project reference in DataAccess.
Is this approach correct?
My Question is, Should Employee.cs class be added to each project entities like I did above or should Employee.cs be added to only Business.Entities project and Business.Entities proj reference be added to all projects?
I got this question because the 2nd approach was used in a project I downloaded from internet.
Please help.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
You should follow one basic principle : Do not write redundant code. i.e. If you add Employee.cs to all the projects it would simply be the copy paste. Any change in this class will force you to change it in all the projects.
My recommendation :
As you have mentioned, you have Business.Entity project, add all the entities including Employee.cs in this project only. And then this project be added as a reference to rest of the projects.
Hope this helps.
All the best.
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
Thanks Pravin. You pointed out not to write redundant code and that is excellent.
But I have a question here. When following layers, do we not have to add the reference of Business in DAL, Presentation in Business etc. so that the flow will be maintained.
If Business project is added as reference on all projects, would the layered architecture model not be affected?
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
I highly appreciate your response. You raised a very correct and genuine concern. You have two options.
Options 1:
Keep the business entity and business logic altogether different. In business entity you will have only public properties exposed. in simple terms it will act as a container for the data that flows through the layers. And business logic will have the core busines logic in it. Now, in this approach you only need to add the reference of Business entity in all the layers. Presentation, Business and DAL.
Options 2:
You will have no difference between Business logic and Entity. You can merge these two layers. i.e. Public properties and the business logic pertaining to that will be in the same class. Validation also goes in the same class. In this case you will have to add reference of this layer to both presentation and Data layer.
Both these approaches are used extensively in the Software Industry. However, second approach is much more extensively used, even it is used in MVC, MVP and MVVP architecture.
Hope this helps.
All the best.
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
Thank you so much.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
My pleasure.......
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
how can i create user for new login form
kunal singh Rajput
|
|
|
|
|
I guess you can create it on your users table.
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
To create a user you can make a registration form for filling userid and password choosing by the user.
These values should be inserted in databse and can be used for further login.
|
|
|
|
|
This may help[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I am working with a C#.net web forms 2010 application that I am going to be adding some web forms to the entire application. I am asking the following question since I have C#.net expereince working with desktop applications.
When debugging a desktop application, I can 'step into the code' for a designer. (This may be allowed since the code generated by the designer is C# code.)
Thus, I would like to know if I can 'step into' the code generated by the asp.net designer. This code ends up being html. If this is possible, can you tell me how to step into this html that the desginer setup and/or point me to reference on how to debug the html (designer code)?
Also can you debug xml (like the web config file)? If so,would you point me to a reference i can use for debugging xml?
|
|
|
|
|
|
Hi
When clicking the log out button on my ASP web application, the following is executed
Session.Abandon
but when i click the back button on the ie browser, i'm being redirected to the previous page though the session has expired.
I've tried using the no cache code
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
This has worked as after logout when I clicked on the ie browser back button i'm being redirected to the login page
But when the session hasn't expired and the user is using the application and at some point when he clicks the ie browser back button, he is getting the ie error message "Page cannot be displayed". I think this being caused by the no cache code
Is there any way to avoid this?
Cheers
|
|
|
|
|
I think this is because of the expiry that you have set for the response.
Could you please try remove the expiration and only use,
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Buffer = True;
This is not a tested code. If you try this way then it should work. I assume that you have proper session validation logic in your pages.
|
|
|
|
|
thanks for the reply but the code you've mentioned is for ASP.Net not ASP.
I need for ASP
modified on Tuesday, September 20, 2011 6:43 AM
|
|
|
|
|
Oh, I thought it was for ASP.NET.
Could you please try the same logic in ASP (remove the expiration)?
You'll find some equivalent snippets in ASP.
|
|
|
|
|
I did but it didn't work out.
Was thinking if there is a way to refresh the page when the back button on the ie browser if triggered
modified on Tuesday, September 20, 2011 8:20 AM
|
|
|
|
|
hello very one
i need some help or advice from the people , who have expert in asp.net
this is my problem
the url for example is
http://localhost:2940/website/page.aspx?ID=1
when i change id to
http://localhost:2940/website/page.aspx?ID=100000000000000000000000000000000000
i get error manege
The conversion of the nvarchar value '20000000000000000000000000000000' overflowed an int column.
i need if the ID dose not exist in database table , redirect the page to homepage
thx all
|
|
|
|
|
I believe you are converting this value into int type and it's exceeding the max size. So use Long type.
Parwej Ahamad
|
|
|
|
|
there is 2 way to handle this issue
1) increase the size of Column of id in database
2) before executing query for existing of id check length of ID
if it is less then the column size then go ahead. else return false from there no need to execute query.
I prefer to use 2nd method.
Remember one thing that when you execute sql query always check length of fields which you are using in query.
Thanks
As our case is new, we must think and act a new.
Abraham Lincoln
|
|
|
|
|
In the Page_Load event...
[put code to check if ID is valid here, then. . .]
If (NotValid)
{
Server.Transfer("Default.aspx");
}
else
{
DoAllTheNormalStuff();
}
|
|
|
|