in the global.ascx file might be an option. I could setup a static object per application that contains some the error details and the time logged and check it and cancel the email notification if need be?
dlRSS.DataSource = GetRSSFeed("http://www.foodsafetynews.com/headlines.xml") dlRSS.DataBind() Function GetRSSFeed(ByVal strURL As String) As DataTable 'Get the XML data Dim reader As XmlTextReader = New XmlTextReader(strURL) 'return a new DataSet Dim ds As DataSet = New DataSet() ds.ReadXml(reader) Return ds.Tables(2) End Function <asp:DataList ID="dlRSS" runat="server" Width="100%" > <ItemTemplate> <strong><p><div><asp:HyperLink ID="TitleLink" runat="server" Text='<%# Eval("title") %>' Target="_blank" NavigateUrl='<%# Eval("link") %>'/></div></p></strong> <strong><p> <div><asp:Label ID="SubtitleLabel" runat="server" Text='<%# Eval("description") %>' /></div></p></strong> </ItemTemplate> </asp:DataList>
But is returning all rows in RSS Feed I would only like top 5 or so
Hi, I want to show the sequence number for the exception (from sequence number column in ELMAH_Error table) , not the GUID to the user whenever an error occurs. is this possible? I found this post Problem passing ELMAH log id to Custom Error page in ASP.NET, but it gives the GUID, I would like to know how I can access the sequence number in Logged event of ELMAH component?
I want to send email thought asp.net page for that I need to find SMTP Host and port number below is my codeÂ
 Dim EMail As New MailMessage     EMail.From = New MailAddress(Emailtaxebox.Text)     EMail.[To].Add(New MailAddress("sa@gmail.com"))     EMail.Subject = Firstnametextbox.Text + lastnametextbox.Text + "Registerd"     EMail.Body = " This is content "    EMail.IsBodyHtml = True
[code]....
how to find SMTP port and host name ? I used default one  its gives me error.No connection could be made because the target machine actively refused it.
I have the code above, if after half of the emails were sent out, there is a error in smtp, then how can I avoid resending emails or missing emails in this cases ?
I am able to get a token with Windows Live Delegate Authentication samples provided by Microsoft.
Now I want to access emails (New, Read, Unread etc) from live account. How can I achieve it with the help of Windows Live Delegate Authentication? Are there any examples for the same?
The Samples given by Microsoft are not related to emails.
I'm building an ASP.NET MVC site where I want to limit how often authenticated users can use some functions of the site.
Although I understand how rate-limiting works fundamentally, I can't visualize how to implement it programatically without creating a major code smell.
If it matters, all of these functions are currently expressed as Actions that only accept HTTP POST. I may eventually want to implement rate-limiting for HTTP GET functions as well, so I'm looking for a solution that works for all such circumstances.
I am reading an rss feed and I am binding it to a repeater. I would like to select the 3 most recent posts. in my XPathExpression I use AddSort The data are sorted just fine but when I bind to the repeater the sort is lost.
That is my first issue. I am using xpath expression [position()<=3] to limit to 3 items. This, however, occurs prior to the sort. So, I would not be getting the 3 most recent records but rather the first three from the feed which are then sorted (if I get the sorting working properly with the repeater). Here is a code snippet.
Dim xpn As XPathNavigator = New XPathDocument(RssURL).CreateNavigator _xmlnsm = XmlHelper.GetXmlNameSpaceManager(xpn) Dim expr As XPathExpression expr = xpn.Compile(String.Format("/rss/channel/item[position()<={0}]", numRecords)) expr.AddSort("title", XmlSortOrder.Descending, XmlCaseOrder.None, "", XmlDataType.Text) Dim iterator As XPathNodeIterator = xpn.Select(expr.Expression, _xmlnsm) rptNews.DataSource = iterator rptNews.DataBind()
I have a site that I am developing with VS 2008. I have a breakpoint set in my code behind file. This file is vast as some of it was created with Iron Speed 7.0. What I'd like to do is limit the debugger to the one file. That is, no matter where the code goes it skips over code in other files, and automatially breaks when execution returns to the file I put the break point in. The code is too vast to step a bit at time and choose to step into or out of bit of code. I want it to just debug the current file.
I have a site under construction which has a control panel for login/logout and it is in an include file on every page.
We currently have a "login page" which functions just fine but I want to take that and incorporate it into the control panel so the user could log in from any page.
Problem is that the .NET programmer wrote all of the login logic using code behind only on one single page.
Is there some way for me to work around this or to incorporate this vb code into every page so that the cpanel can function as it should?
I am using AutoCompleteExtender on a text box as follows
[Code]....
My problem is the autocomplete returns a long list of recods ,I want to limit it to maximum 10 recods .How can I do that? I set CompletionSetCount="10" ,but it doesn't seem to work How can i do that?
I need to limit the length of the string that load into a DataTable that is being used to display. The data I am loading is coming from another DataTable. How do I shorten row["CG_GalleryName"] contents to 24 characters.
Convert.ToString(row["CG_GalleryName"]) -- how do I set this length to 24 characters? Using it in the below code.
I am using the asp.net and framework 2.0 with Ajax enable web.i have a text box and when user will enter "a" or number in this will search the name started from "a" character or number if he or she enter the number basically we can say live-search.
Employee search: Textbox.In this text box she/he will enter the first character of name or first number of employeeno and according to the a character name will search in list.
I wantto make a slower transmitting/transferring data speed for debugging issues.(no threading sleep is not my answer) searching a way to limit webdev.webserver speed (bandwidth) ?
for example maybe checking on "custom web server=webdev.webserver /BandwidthLimit=128bs"
I have a Gridview showing the MemberLastName, MemberFirstName, MemberBirthYear, MemberGender, MemberRelationship.
During Edit mode, I have managed to display a DropDownList for the Relationships.What I am trying to achieve now, is that, based on the Gender of the member I would like to limit the items in the Relationships dropdownlist.
e.g if the Gender is Male, then only display Male Relationships
What is the best way to achieve this scenario?Here is my snippet of code for the event. The code is commented out as it throws an exception.
How do I limit my result in my Gridview to 1 decimal places and insert kWh after each answer. For example my current result is 15.513 Im looking to have it display 15.5 kWh. Is this posisble I know for standard stuff like currency symbols you can use
A customer has a site written in ASP.NET and C# (.NET4 VS2010). I have been asked to link videos into some pages. The videos are hosted on vimeo and are flagged as private so general public can not view them (on vimeo.com). The user has stipulated that if an unregistered user (unregistered on the customers site) views a video they should only see the first 5 minutes. After those 5 minutes they should be prompted to register or log in. I'm fine with forms authentication in ASP.NET.
At this stage I do not know what type of account the customer has on vimeo, I am waiting for that information. I do not have any code examples to add.
Ideally I need to prevent users from downloading (either directly or by some other way) videos maybe by obfusticating the actual urls in some way.
What I was wondering is if controlling the length of a video being viewed from vimeo, especially in the registered/unregistered user context on an ASP.NET site.
I'm following this blog post about setting up ELMAH with MVC: [URL] I've only done part 1. Everything works correctly if I simply go to the Home controller, and then cause an error. I can view /elmah.axd as well, and my errors are logging in the database correctly.
However, I've added an area to my application named Admin. If I navigate to /Admin, I receive the following error:
System.MissingMethodException: No parameterless constructor defined for this object. public override IController CreateController(RequestContext requestContext, string controllerName) { var controller = base.CreateController(requestContext, controllerName); //Error here var c = controller as Controller;
I'm assuming this has something to do with my Area.
EDIT for jfar:
For instance, I have an Employees controller in my Admin area:
public class EmployeesController : Controller { private IEmployeesRepository employeesRepository; public EmployeesController(IEmployeesRepository employeesRepository) { this.employeesRepository = employeesRepository; } //... }
I have ELMAH setup on my production server and it has done a fantastic job of letting me know about any niggles - as well as any creative SQL injection!I've decided to introduce URl Rewriting and went for http://www.urlrewriting.net/ in the end. It was nice and easy to setup and it's doing exactly what I want with the customer-facing site.The problem is ELMAH. Because I've set the urlrewritingnet node in my config like so:
I'm interested in using ELMAH but need to configure it programmatically. We have existing infrastructure for determining connection strings and the like, and can't code them into Web.Config.How do I go about using ELMAH in this case?
I'd like to configure ELMAH for an ASP.NET MVC site entirely in code. This includes registering the module, setting the logging provider and settings, and filtering exceptions.The only part I've managed to do so far is filter exceptions. Has anyone else figured out how to do this? I'd really like to avoid cluttering up my config file with settings that won't ever change.
There used to be an article at ELMAHs docs site that contained this information, but it seems to have been removed. I think it's as simple as setting a configuration setting in the section, but I haven't a clue what it isCan anyone take a few seconds and drop the configuration setting here?