|
NULL and ListName.Count are two separate things.
NULL means the ListName is not initialized yet (so you can't access any properties either).
ListName.Count > 0 means that the ListName object is initialized, but just doesn't contain any items.
What you want to have is:
if(ListName != null && ListName.Count > 0) { }
or
if(ListName != null && ListName.Any()) { }
|
|
|
|
|
i have initialised the LIST like so:
LIST<Next_Page> nxt = new LIST<Next_Page>();
nxt = dbh.GetNextPage(cId, "1.1");
if (nxt.Count > 0)
{
}
and should the LIST contain no records i get a runtime error:
index was outside the bounds of the array....yak yak yak.
same applies to when i use Any();
|
|
|
|
|
Then the GetNextPage method returns NULL and not an empty list.
|
|
|
|
|
Hi All,
I recently joined a new company in that company they are using some sort of files with extension ".hrx" in asp.net web application. When I enquired them about these files they said their purpose is for event handling.
Can anybody give me some information about the hrx file, it uses and samples. Any sort of links any adive anything would be great helpfull.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Never heard of hrx in relation to asp.net event handling. However, an assembly can have any extension and still be an assembly.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I want to know if it's better to add the meta tags (index) and (follow) into my asp webpage in order to get the foundon the search engines?
|
|
|
|
|
it is my opinion that meta tags are becoming less and less important and i use only description and keywords. More important on SEO side of life is that we build links to your site and that it has content and says something or does something useful.
|
|
|
|
|
what if I don't want a specific page to be shown on the search engine? for example, contact us page?
|
|
|
|
|
look up robots.txt on google and find out more info about that
|
|
|
|
|
hi,
im having a popup window.in that popup window, i dont want the minimize button of the browser window.im using ie6.
by window.open() method i disabled the maximize button. is there any way to disable or hide the minimize button?
Its an urgent requirement,kindly help.
thanks in advance.
|
|
|
|
|
|
hi,
I used All The Features Of WIndow.open() method but they doesnt work to disable or hide the minimize button..
can you please suggest any other way to do this.
Thanks in Advance.
|
|
|
|
|
Hi
I have a query regarding redirection to Login page, which I am not being able to trace out.
When I click on any of the tab in my application (which internally loads a new aspx page) sometimes it
is redirected to Login.aspx, which is unexpected. Couldnot debug why this is happening even by javascript alerts and C# debugging statements.
Below is the view source piece from Login.aspx, just for clue
<form name="Form1" method="post" action="login.aspx?ReturnUrl=%2fValuations%2fToDoList.aspx" id="Form1">
Valuations is the dll of application and ToDoList.aspx is the tab page I clicked which should load, but suddenly Login.aspx page is displayed. I traced the complete solution project.
Can you please help me...?
- Ajay K
|
|
|
|
|
what does your web.config file say?
|
|
|
|
|
Irrelevant
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
can you please refer to below config file -
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<section name="enterpriselibrary.configurationSettings" type="Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManagerSectionHandler, Microsoft.Practices.EnterpriseLibrary.Configuration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<log4net>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="Logs/Valuations.log"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyyMMdd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger. %M - %property{user} - %message%newline"/>
</layout>
</appender>
<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<to value=""/>
<from value="BarracudaFrontEnd@us.hsbc.com"/>
<subject value="BarracudaFrontEnd Error Warning"/>
<smtpHost value="nysuntrade03"/>
<bufferSize value="512"/>
<lossy value="true"/>
<evaluator type="log4net.Core.LevelEvaluator">
<threshold value="ERROR"/>
</evaluator>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger.%M - %property{user} - %message%newline"/>
</layout>
</appender>
<root>
<level value="DEBUG"/>
<appender-ref ref="RollingFile"/>
</root>
</log4net>
<enterpriselibrary.configurationSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" applicationName="Application" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
<configurationSections>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData" name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="dataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<keyAlgorithmStorageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibrary.configurationSettings>
<appSettings>
<add key="entities" value="HBUS-New York,HBEU-London,HBFR-Paris,HBFP-Paris,HBAP-Hong Kong" />
<add key="sftpAddressRecords" value="5" />
<add key="DefaultDate" value="2003-09-01" />
<add key="ServerName" value="UAT" />
<add key="disableSimultaneousLogins" value="Y" />
<add key="senttoDMLservletPath" value="http://136.50.107.141:9080/dev/approvedOrCancelledAction.do"/>
<add key="approverejecttltproc" value="GVS_TLT_PKG.APPROVE_REJECT_TL" />
<add key="tlt_delete_proc" value="GVS_TLT_PKG.PROC_SUBMIT_TLT_DELETE" />
<add key="approverejectclientproc" value="GVS_CLIENTPROFILES_PKG.ApproveRejectClient" />
<add key="Environment" value="QA"/>
<add key="ServletCommTimeout" value="9000"/>
<add key="RevisedTradeColor" value="#faa5a0" />
<add key="UnMatchedTraderTicketColor" value="#ffffff" />
<add key="CancelledTraderTicketColor" value="#cdcdcd" />
<add key="AllocatedTraderTicketColor" value="#ffff64" />
<add key="MatchedTraderTicketColor" value="#99ff99" />
<add key="TradertoTrader_StreetTradeColor" value="#F4A460" />
<add key="MAPagingDifference" value="50" />
<add key="PagingDifference" value="50" />
<add key="frequencies" value="DAILY,WEEKLY,FORTNIGHTLY,MONTHLY,QUARTERLY,SEMIANNUALLY,ANNUALLY,RANDOM,EOM,EOQ,EOHY" />
<add key="InclExclPagingDifference" value="100" />
<add key="TQTPagingDifference" value="500" />
<add key="TLTSearchRecords" value="500" />
<add key="ManagingLocation" value="Hong Kong,London,New York,Paris" />
<!--<add key="ManualTradeServlet" value="http://136.50.107.141:9080/dev/UploadAction.do" /> -->
<add key="ManualTradeServlet" value="http://136.50.107.141:9080/dev/UploadAction.do" />
<add key="CheckForUpdates" value="60"/>
<add key="appPath" value="http://localhost" />
<add key="TQTDownloadPagingDifference" value="5000" />
<add key="TQTDownloadLimit" value="60000" />
<add key="gvsadminpkg_getuserdata" value="GVS_ADMIN_PKG.GetUserData" />
<add key="gvsadminpkg_saveuserdata" value="GVS_ADMIN_PKG.SaveUserData" />
<add key="gvsadminpkg_adminops" value="GVS_ADMIN_PKG.AdminOperations" />
<add key="gvsfeedpkg_updatestmtstatus" value="GVS_PROCESS_FEED_PKG.PROC_UPD_STMT_FE" />
<add key="excludedproducts" value="FXS,SDS,SPM,SPT,SWO,ASW,BMO" />
</appSettings>
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="styles">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Administration">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<pages buffer="true" enableSessionState="true" enableViewState="true" enableViewStateMac="false" />
<identity impersonate="true"/>
<httpHandlers>
<!--<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />-->
<add verb="*" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
<httpRuntime executionTimeout="60000" maxRequestLength="100000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true"/>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="c#" debug="true"/>
<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.
"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx">
<error statusCode="500" redirect="ErrorPage.aspx?err=500" />
<error statusCode="404" redirect="ErrorPage.aspx?err=404" />
<error statusCode="403" redirect="ErrorPage.aspx?err=403" />
</customErrors>
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"
"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
slidingExpiration=[true|false]
-->
<authentication mode="Forms">
<!--
<forms loginUrl="login.aspx" name="adAuthCookie" timeout="600" path="/" slidingExpiration="false" />
-->
</authentication>
<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<!--<allow users="*" />-->
<!-- Allow all users -->
<deny users="?"/>
<!-- Deny anonymous users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
<!--<identity impersonate="true" />-->
<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
mode="Off|InProc|StateServer|SQLServer"
-->
<sessionState mode="InProc" timeout="36"/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
</configuration>
|
|
|
|
|
You are being redirected to the Login page because the authentication cookie has either expired or has not been set. If the page is in another application with its own set of security requirements then it too needs to authenticate the user before serving the request.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark ,
could you please elaborate me on the same thing you replied me - where exactly shall i look ?
the markup given
<form name="Form1" method="post" action="login.aspx?ReturnUrl=%2fValuations%2fToDoList.aspx" id="Form1">
is of the login-page which is finally displayed unexpectedly, and we have no-where set such form-action in application so as to redirect to login.aspx.
And I have used tabs-based UI control in my application where I click around and if kept any page in the tab idle for sometime(may it be 2-5-10-15 mins), and clicks on another tab link in the application, it suddenly redirects to Login.aspx page.I saw the view source of that login page and pasted above.
Thanks
- Ajay K
|
|
|
|
|
i would imagine your getting login because it is stated in the authentication/authorisation part of web.config. Deny users'?' will force all annonymous users out to the login.aspx page.
|
|
|
|
|
It is not unexpected to be sent to the login page after the authentication token has expired, you have been told this several times.
The form action is automatically created by ASP.NET.
Review this
ASP.NET Authentication[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for your co-operation, Mark .
But could you please reply me any flaw in config file I pasted earlier, which is making it redirected to login.aspx automatically .
- Ajay
|
|
|
|
|
You are not understanding. THIS IS EXPECTED BEHAVIOR. You have been told that several times. THIS IS EXPECTED BEHAVIOR. The authentication token has expired. THIS IS EXPECTED BEHAVIOR. Read the information you have been given. THIS IS EXPECTED BEHAVIOR.
Is this clear to you now!!!
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for your reply, Mark.
But I am unable to get your explanation because of below statements -
deny = * means deny everyone
deny = ? means deny unauthenticated users
So we are using deny = ?, which is correct and has to be there(I think), so how could it be expected behaviour - thats what I am confused with..
Means is it expected every web-app logs out after 10 mins...?
- Ajay
|
|
|
|
|
READ THE DOCUMENTATION
I know the language. I've read a book. - _Madmatt
|
|
|
|