|
Hi,
Can someone explain the following to me. If I set a value in my Business layer, I am able to access it from another page?
<br />
'Code behind page<br />
'Import the BLL layer<br />
Import MyApp.MyBLL<br />
<br />
'Method to Set the value<br />
MyBLL.SetPermission(1)<br />
'Method to Retrieve the value<br />
Dim intPermissionLevel = MyBLL.GetPermission()<br />
<br />
'Business layer<br />
<br />
'The value to be kept<br />
Public Shared intPermissionLevel As Integer<br />
<br />
'Go find the user Level<br />
Public Shared Function GetPermission() As Integer<br />
'Go find the user Level<br />
Return intPermissionLevel<br />
End Function<br />
<br />
'Go Set the user Level<br />
Public Shared Function SetPermission(ByVal intSetPermissionLevel As Integer) As Integer<br />
'Go Set the user Level<br />
intPermissionLevel = intSetPermissionLevel<br />
End Function<br />
<br />
I am able to get the value set in "intPermissionLevel", from another page. I set it in say page1.aspx, and then I can get the value again, from page2.aspx
Is this because the value is shared - and is this a good method? I do not quite understand this....
|
|
|
|
|
>>Is this because the value is shared
Ya.
>>is this a good method?
It depend on your system and what you wanna do with this member.
If you set the method/property as shared then you don't need to create an instance of object in every pages. so, it has less memory allocation. but you hav to take care of concurrency issue. (what if multiple users are accessing your page at the same time.)
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
I am getting an error 'No default printer' when I tried to print a report.
Some articles suggested to set the Username as system in processModel in machine.config. I did the same but no improvement, getting the same error.
Any one help me out here.
Thanks.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Are you able to print something manually from your machine? Eg: type something in notepad. And Click "Print".
For me, there is nothing required to update in machine.config.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
Its working if I print from notepad and all. Its not working only for crystal report printing.I am using network printer as my default printer.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
>>I am using network printer as my default printer.
ya.i'm using network printer only .. it's working fine for me.
i think, ASP.NET doesn't have a permission to access this printer. so, you should try to impersonate with your user id.
IIS,
- Go To-> IIS -> Properties -> Directory Security ->
- Uncheck "Anonymous access"
And,
In Web.Config,
<identity impersonate="true"/>
<authorization>
<deny users="?"/>
<allow users="*" />
</authorization>
Hope, it would help.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
Thanks for valuable feedback. But I have to give access to Anonymous users
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi Friends
I use SFR sensor in my web application using asp.net with c#.
When I click on button to initialize SFR I got Error.
bool returnvalue = sfr.Initialize();
Error is:- A call to PInvoke function 'Suprema!Suprema.SFR300::SF_SetSensitivity' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Plz give me right solution
Thanks in advance
Pathan
|
|
|
|
|
no idea what SFR is. sorry.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
SFR is a fingerprint scanner.
Pathan
|
|
|
|
|
Hi ,
I am getting the following Error when i try to open an Asp.Net page .
'http://localhost/webapplication1'. HTTP/1.1401 Access Denied'
1.My iis running properly i checked
2.i have given aspnet_regiis –i this command in vsCommandPrompt still the above message i am getting
3.windows Application working properly.
Pls tell me how to solve this and how to run my asp.net page.
Thanks inAdvance
|
|
|
|
|
Give Access rights to Internet Guest Account(IUSR_<machine name="">) to the folder C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
respected gurus
if i use
Response.Write("window.open('frmdisplayrpt.aspx','new_win');")
on click of a button from one web page..
then page_load event of frmdisplayrpt.aspx will fire or not.
tell me in detail
|
|
|
|
|
Page load event of frmdisplayrpt.aspx will fire
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi,
I have a webform and in that for the data is represented in a table such as:
table, tr and thereby three td's. Now there are textboxes in the first column as well as in the last column, however on clicking a button like 'clear' the textboxes content in column 3 should be cleared.
Tried using the foreach loop along with table, tablerow, tablecell but throws an error!!!
Gautham
|
|
|
|
|
HI Gautham.
Try this code
foreach (System.Web.UI.HtmlControls.HtmlTableRow tr in tbl.Rows)<br />
foreach (System.Web.UI.HtmlControls.HtmlTableCell tc in tr.Cells)<br />
foreach (Control txt in tc.Controls)<br />
if (txt is TextBox)<br />
((TextBox)txt).Text = string.Empty;
//tbl is table id
Pathan
|
|
|
|
|
Thanks for the reply!
However i want to write the code in the button_click event and inorder to access the table i have given runat=server for the table so i have given:
foreach(TableRow tr in Table1.Rows)
{
foreach(TableCell tc in tr.cells)
{
foreach(controls con in tc.controls)
........
.......
.........
however this gives an error!!!
Gautham
|
|
|
|
|
|
foreach statement cannot operate on variables of type 'System.Web.UI.HtmlControls.HtmlTableRow' because 'System.Web.UI.HtmlControls.HtmlTableRow' does not contain a definition for 'GetEnumerator', or it is inaccessible
Gautham
|
|
|
|
|
Please post the exact error message and actual code. this will help us to solve your problem.
Regards,
Mark
|
|
|
|
|
hi
If you know the ID of the HtmlTable where the textboxes are available you can do it as
<br />
<br />
HtmlForm form = (HtmlForm)Page.FindControl("Form1");<br />
HtmlTable tbl = (HtmlTable)form.FindControl("Table2");<br />
<br />
foreach(HtmlTableRow row in tbl.Rows)<br />
{<br />
foreach(HtmlTableCell cell in row.Cells)<br />
{<br />
foreach(Control ctrl in cell.Controls)<br />
{<br />
if(ctrl is TextBox)<br />
{<br />
((TextBox)ctrl).Text = "";<br />
}<br />
}<br />
}<br />
}<br />
<br />
This will work..But you need to know the ID of the table which contains the Textbox controls to be cleared
|
|
|
|
|
HtmlForm form = (HtmlForm)Page.FindControl("Form1");
HtmlTable table1=(HtmlTable)form.FindControl("table1");
for(int i=0;i<table1.rows.count;i++)
{
="" foreach(htmltablerow="" tr="" in="" table1.rows[i])
="" foreach(htmltablecell="" tc="" tr.cells[i+2])
="" foreach(controls="" cont="" tc.controls)
="" if(cont="=TextBox)
" ((textbox)cont).text="" ;
="" }
="" }
error:=""
foreach="" statement="" cannot="" operate="" on="" variables="" of="" type="" 'system.web.ui.htmlcontrols.htmltablerow'="" because="" does="" not="" contain="" a="" definition="" for="" 'getenumerator',="" or="" it="" is="" inaccessible
=""
<div="" class="ForumSig">Gautham
|
|
|
|
|
for(int i=0;i<table1.Rows.Count;i++)
{
for(int j=0;j<table1.Rows[i].Cells.Count;j++)
{
foreach(Controls cont in table1.Rows[i].Cells.Controls)
{
if(cont==TextBox)
((TextBox)cont).Text="";
}
}
}
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
Just use the code what i have pasted because that code is working fine.
Try and let me know
|
|
|
|
|
Hi,
I'm using ASP.NET Integrated Windows Authentication for my Intranet site. If a user logs in, I like to provide the option of "Login as Another User". If the user selects the option, I need to prompt the user for User name and password (like basic windows authentication) and provide access.
Pls help how to implement the same.
Thanks in advance
rgds,
Prabhu
|
|
|
|