Warning: Cannot modify header information - headers already sent by (output started at E:\HostingSpaces\nextroot\nextroot.com\wwwroot\index.php:1) in E:\HostingSpaces\nextroot\nextroot.com\wwwroot\wp-includes\feed-rss2.php on line 8
NextRoot http://www.nextroot.com Just another WordPress weblog Sat, 17 Apr 2010 19:44:36 +0000 http://wordpress.org/?v=2.9.2 en hourly 1 New website http://www.nextroot.com/2010/04/17/new-website/ http://www.nextroot.com/2010/04/17/new-website/#comments Sat, 17 Apr 2010 18:59:37 +0000 Stefy http://www.nextroot.com/?p=42 I recently change the hosting and I decided to change the blogging framework we use. So we are not using BlogEngine .NET and we are now using Wordpress. The major problem we had with BlogEngine was the lack of support for spam comments. Wordpress also has a big advantage by having a lot of plugins developed.

I’m still working on the theme currently but the site will be stable in one week.

]]>
http://www.nextroot.com/2010/04/17/new-website/feed/ 0
ASP .NET MVC – Validate Request problem http://www.nextroot.com/2009/04/07/asp-net-mvc-validate-request-problem/ http://www.nextroot.com/2009/04/07/asp-net-mvc-validate-request-problem/#comments Tue, 07 Apr 2009 15:58:13 +0000 Stefy http://www.nextroot.com/?p=7 As I said in my previous post, I’m working on an ASP .NET project and I’m learning new things about this technology

I had to integrate a WYSIWYG editor in my project and after doing that I got the classic ‘A potentatially dangerous Request.Form value was detected from the client’ exception at runtime. This error appears because I tried to post a string that was recognized by the server as a potential cross-site scripting attack. In classic ASP .NET in order to resolve this problem you can either encode the string and decode it back when using it, or you can add the ValidateRequest=”false” in you Page directive.

So I went for the second choice, but I was still having the same problem. After a little digging on Google I found what was the actual problem. In ASP .NET MVC all the validation is made at the controllers level. That’s quite logic because when the controller is executing we don’t know what view is going to be rendered. Additionally, if a user posts a malicious script by the time the view is rendered it’s too late to do anything about it. So in order to resolve the problem you have to decorate your controller or action with the attribute [ValidateInput(false)]. That way we can tell the controller or the action to surpress any validation.

]]>
http://www.nextroot.com/2009/04/07/asp-net-mvc-validate-request-problem/feed/ 0
ASP .NET MVC – Dynamic controls http://www.nextroot.com/2009/04/07/asp-net-mvc-dynamic-controls/ http://www.nextroot.com/2009/04/07/asp-net-mvc-dynamic-controls/#comments Tue, 07 Apr 2009 11:27:46 +0000 Stefy http://www.nextroot.com/?p=18 I’m currently working on a project made with ASP .NET MVC and I had one problem the other day: How can I get the value of a dynamic generated input control in a controller? For example, let’s say that you have to put a number controls (textboxes, checkboxes etc.) on a view based on your applications logic. When the page is posted back to the server you want to be able to check the values of those controls in order to process them. To get those value you’ll have to look in the Request.Form collection after the name of your control.

]]>
http://www.nextroot.com/2009/04/07/asp-net-mvc-dynamic-controls/feed/ 0
ASP .NET Tutorials – Episode #2 http://www.nextroot.com/2008/10/04/asp-net-tutorials-episode-2/ http://www.nextroot.com/2008/10/04/asp-net-tutorials-episode-2/#comments Sat, 04 Oct 2008 19:43:18 +0000 Stefy http://www.nextroot.com/2008/10/04/asp-net-tutorials-episode-2/ Hello,

The second episode from our ASP .NET tutorials in Romanian is online. This episode covers the standard ASP .NET controls, masterpages, themes and web parts. You can also find a really interesting section for advanced users.

]]>
http://www.nextroot.com/2008/10/04/asp-net-tutorials-episode-2/feed/ 0
ASP .NET tutorials and screencasts http://www.nextroot.com/2008/09/17/asp-net-tutorials-and-screencasts/ http://www.nextroot.com/2008/09/17/asp-net-tutorials-and-screencasts/#comments Wed, 17 Sep 2008 16:31:10 +0000 Stefy http://www.nextroot.com/?p=21 Hi there. Me and Mihai Tataran, director of HPC Consulting (the company where I work) are writing some ASP. NET tutorials for the Romanian ASP .NET developer community. Each tutorial will cover the basis of ASP .NET, but we also have a section for advanced developers. Our first tutorial is presenting an introduction to ASP .NET and the advanced developers section features an interesting article about UrlRewrite. Each of these articles has a screencast. To read the first tutorial press here (text and screencasts are in Romanian).

]]>
http://www.nextroot.com/2008/09/17/asp-net-tutorials-and-screencasts/feed/ 0
What is the __doPostBack function and how can it be used? http://www.nextroot.com/2008/09/13/what-is-the-__dopostback-function-and-how-can-it-be-used-part-1/ http://www.nextroot.com/2008/09/13/what-is-the-__dopostback-function-and-how-can-it-be-used-part-1/#comments Sat, 13 Sep 2008 16:05:28 +0000 Stefy http://www.nextroot.com/?p=10 This article would like to explain the functionality of the postback mechanism in ASP .NET and how the pages can be posted to the server from client code.

Let’s suppose we have a simple ASP .NET page which contains a LinkButton:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LinkButton ID="lnkTest" runat="server" />
    </div>
    </form>
</body>
</html>

When this page is render if we take a look at the source of the page (any modern browser has this feature, just press right click on the page and select View Source or View Page Source) it’s going to look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>

</title></head>
<body>
    <form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTc5OTI5MzM1ZGRIdK4YuAGq1dppJ0EPmqso2jMx1g==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>

<div>
 <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLrmfXzCgKSw44DvJoR+Ww1XMuknKIlXE7tgDogJ9c=" />
</div>
    <div>
        <a id="lnkTest" href="javascript:__doPostBack('lnkTest','')"></a>
    </div>
    </form>
</body>
</html>

First of all we can see that our LinkButton is rendered as an anchor element (<a> tag). Also the reference of that link points to a javascript function named __doPostBack, which is defined earlier in the page. This method has 2 parameters: eventTarget (this is the id of the control that determines the function to be executed) and eventArgument (this is an optional argument which can be set up if needed).

If we inspect the code of the __doPostBack function we can see that it first sets the values of two hidden fields created by ASP .NET named __EVENTTARGET and __EVENTARGUMENT with the two parameters passed to the function. After this the page is submitted back to the server.

When a page is posted back to the server ASP .NET inspects __EVENTTARGET and __EVENTARGUMENT values and this way it can decide which of the controls caused the page to be postedback and what is the event that has to be handled.

]]>
http://www.nextroot.com/2008/09/13/what-is-the-__dopostback-function-and-how-can-it-be-used-part-1/feed/ 0
Hello world! http://www.nextroot.com/2008/09/05/hello-world/ http://www.nextroot.com/2008/09/05/hello-world/#comments Fri, 05 Sep 2008 11:16:02 +0000 Stefy http://www.nextroot.com/?p=1 We just finished the work on our brand new website and now it’s finally online. For now, our site contains only a short briefing of our company. Soon, here will be some nice and shinny tutorials and tips for all the passionate developers from around the world. Also we’ll keep you posted with stories about our projects, about our work and about us. Keep in touch with us and you won’t regret it.

Good night for now and see you around. ;-)

]]>
http://www.nextroot.com/2008/09/05/hello-world/feed/ 0