|
See my first reply. It don't use any session object there.
If you have 10 input tag of type text with name attributes: txt1, txt2, txt3...
After you submit the page to the server you use Request.Form[txt1], Request.Form[txt2]....
No session object.
|
|
|
|
|
If you want to transfer all the values using postback then you can use Page.PreviousPage method to get the previous page controls and it's information.
Please check MSDN Article[^]
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
Hi, I have something I want to understand regarding the oAuth flow in facebook.
I have a facebook application that I created.
When I reach my application site directly (not through facebook) i.e enter my application site URL in the address bar, I reach my application. Let's say: https://myApp.com/fbApp
On the server side there's the oAuth flow ( sending a request for the "code" parameter and then with the "code" parameter another request for the "user access token").
I wanted to know how does Facebook knows who is the user that is making the request for the "code" parameter. I noticed that when I'm loged-in to facebook and I'm going to my site directly (as described above) I'm getting the "user access token" on the server side.
When the first request to facebook is made for the "code" parameter, is their anything else being transferred behind the scenes so facebook knows to identify the current loged-in user?
The 'client id' parameter which is being passed to get the 'code' parameter is the 'app id' which is general to all users so I don't see a user specific info being passed to facebook.
|
|
|
|
|
I am a bit confused about when to use connected or disconnected classes when creating an ASP.NET application. Tradition 3-tier apps almost always show that the business layer contains BO (business objects) that are nothing but data containers mapped directly from tables. These classes are coupled with BAL (business application layer) classes. The BO gets exchanged between the BAL and DAL (data access layer).
When can we then use DataTables and DataSets then? Should BO be eliminated in these cases? Is there a need to convert a DataTable to a business object in the business tier?
|
|
|
|
|
IMHO the answer is that you shouldn't use DataTable and DataSet objects at all.
The reason behind using business objects is that (a least in theory) you are not dependant on database. That allows you test your code without db and also think about your code without database context (using "objects" instead of "rows").
Also without additional work, DataTable objects are not strongly typed so you won't find type mismatch errors until runtime.
You know, Entity Framework and similar tools exist for a reason
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
|
I have a gridview with a checkbox column, i select a checkbox in a row and click edit button after that, edit button click_event i wrote this:
grvWorkDetail.DataKeys[grvWorkDetail.SelectedIndex].Values["WorkTimeID"].ToString()
but it has error, and i cant access to "WorkTimeID"
my codebehind is :
<asp:TemplateField ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:CheckBox ID="chk_SelectAll" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chk_Select" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center"
|
|
|
|
|
If you know the row number (i), then you can try
CheckBox cbox = (CheckBox)grvWorkDetail.Rows[i].FindControl("chk_Select");
|
|
|
|
|
I want to create two textboxes in a table row , each time on click of asp.net button control.But i am unable to do so. I searched for it.It deals with page life cycle. but confused with which can do the job like preinit or load event? if possible give me some sample code.
|
|
|
|
|
My suggestion to you is just do it on the client side with regular HTML tags instead of asp.net controls.
Bind to the click event of the button and then add an HTML to a row.
|
|
|
|
|
I am wondering if you can set the MasterType VirtualPath dynamically in the codebehind? I have other code that dynamically changes the MasterPageFile using OnPreInit(), but it seems that the MasterType VirtualPath value has to be hard-coded into the .aspx.
What I would like to do is call a function from the master page, but since the master page is set dynamically, I can't hard-code the VirtualPath into the aspx because I'd be calling the function from the wrong master page if I do.
Anyone know if I can set the MasterType VirtualPath value dynamically in the OnPreInit()? Or can I dynamically cast "this.Master" before calling the function?
Thanks. Any help is appreciated.
|
|
|
|
|
If all your master pages are derived from the same base type, then you can set your MasterType to that base type.
Anything else wouldn't make much sense because if your code depends on type of master page then it either have to be known at compile time so you can't really set it on the fly, or you can check for it at runtime using
if (this.Master is MyMasterOne)
{
var masterOne = this.Master as MyMasterOne;
}
so you don't have to set it anywhere.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
Hello,
I'm developing as ASP.NET web application and I use Crystal report for visual studio 2010, I installed it on my machine.
the application work correctly on my machine, but fire an error on the server.
the error say:
Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
this error fires when I run this page
[^]
I tried many solutions but still the error fire
How can I solve this Error?
|
|
|
|
|
What version of IIS Server are you using?
Well you should reinstall the Crystal Report run time on the server again to re register the class object.
I know what the error code is from c++ programming, and it means you have to elevate your permission level, but I find it strange that you should have to do that.
So I guess if your running on IIS6, then network service has to have permission on the webform, and for IIS7+, the application pool identity. Mayne the program writes temp files that need permission to write or modify.
|
|
|
|
|
thank you for your reply
it works correctly
many thanks for you
|
|
|
|
|
Hi all,
I am using entity framework 1.0 for my .net 3.5 application, is it good to use entity framework with Views or without views in the database.
Which is more efficient?
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I have three tables t1, t2, t3 and there is a PK on t1, t2, and t3. FK realtion between t1.Id and t2.tID, t3.tID and t1.ID and also t1.ID and t3.TID. How to write mapping for this kind of scenario.
|
|
|
|
|
Hey i wanna start a discussion on try catch blocks. I read a lot of conflicting opinions on wether or not to use them and where or where not to use them, I just want a diffinative answer. Cheers.
|
|
|
|
|
Always use them around any code that may throw an exception that you need to deal with.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hey the thing is I know exactly when and where to use them it just seems that all through my code there are 100's of try catch blocks and I read very conflicting articles on wether or not this is best coding practice.
|
|
|
|
|
Mickt1985 wrote: I read very conflicting articles Which just means that everyone has their own opinion. It's up to you to choose which one you think is right.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Although everyone have their own opinion but the main important thing is user should not experience unexpected behavior. if there is something going wrong you need to catch and that could be possible through try..catch and logging the messages.
so resolving errors are more important then best practice... keep coding...
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
I understand that with tools like Codeit.right and The Visual Studio Analysis that Try Catch(s) are to be used sparingly and to catch only certain types of errors. You should try to wirte tests into the code in order to narrow the parameters of the code so that you will be able to report back to users problems. Hiding errors in Try / Catch in not the proper use of the machanic.
Hope this sheds some light on the use.. Try running the code by removing all the Try/Catch and if there is a better way like a If/Then that can cover the error then it is so much better.. in Addition Try/Catch are generally slower.
Regards.
|
|
|
|
|
Thanks very much for your reply.
|
|
|
|
|
If you are interested in executing a certain block of code irrespective of whether an exception occurs or not and still worry about catching an exception you might use the try-catch-finally block. Even if a goto statement is present in a try block, the control gets transferred to the label in the goto, only after executing the finally block.
You should try and use them in your code as much as possible, especially if you suspect a particular error may crash your programme.
Comm100 - Leading Live Chat Software Provider
modified 28-May-14 1:49am.
|
|
|
|