Jump to content
Xtreme .Net Talk

Cassio

Avatar/Signature
  • Posts

    278
  • Joined

  • Last visited

Everything posted by Cassio

  1. Hi, Is the function "ConfirmAction" on your page?
  2. Are you sure you have to use a Repeater? The Repeater control dont have columns like the gridview. Anyway, you can control the visibility of any webcontrol inside the itemtemplate of the repeater. You just have to use the ItemDataBound event, get the webcontrol reference using the FindControl method and set its visibility. Hope this helps.
  3. Thanks for the information, mskeel. The problem is, the system I'm working in is mostly doing CRUD operations. Its a big project but the objetcs don't have much logic inside them. Most of the errors we get is related to the database or the layer responsible for the object-relational mapping. You know, maybe the DBA removed a stored procedure parameter and forgot to tell me. So, it would be nice to test against a real database (not the production database, of course). How do you guys test database stuff, like stored procedures? Nerseus, I will take a look at that. Thanks!
  4. I´m pretty interesting in starting doing TDD, but right now I have a huge class hierarchy to mantain and evolve, most doing CRUD operations. So I have lots of stored procedures calls and too much data dependencies. I tried to play a little with unit testing but I couldn't find an easy way to do it. I heard mock objects would solve my problem, but I still didnt get into it. I´d be glad if anyone could point me in the right direction. :confused:
  5. IMO the greatest bug is the slowness when working with big web projects. :o
  6. I'm from Rio de Janeiro, Brazil. ;)
  7. Hi! I´m working on a 3-layer architecture. And i'm using interfaces for all my classes in the Business Layer. I have a shared library for these interfaces. That was the way I found to make the Data Access Layer handle the Business Layer objects. So I have lots of properties, method calls, casting, parameter passing...and many of them through interfaces. I´d like to know whats the performance impact of this approach. Thanks.
  8. Thanks, I just realised that static methods cant be overrided. Anyway, I was doing this because I have a 3-layer arquitecture, and most of the business layer classes have the same behavior when it comes to Delete, Insert, Update and Select. They call their data layer correspondent class. So I got the Insert and Update functions and put it on the business layer base class. So the base class has to use some reflection to get the data layer class and execute these methods. Thats why I have to know the object thats is calling the method, I use the name of the object to do the reflection. On the Insert and Update methods I had no problem doing this, but the Select and Delete methods are static. So I cant get the class that is calling it to do the reflection. But I guess Ill just keep these methods on the derived classes. Thanks ;)
  9. Hi! I have a base class called A and the derived class called B. In class A I have a virtual method called Select() that I call using an instance of class B. Class B does not override the Select() method. For some reason I have to get the name of the derived class in the Select() method. I do that using this: string typeName = this.GetType().ToString(); Now I have to change the Select() method and make it static. So now I cant use the "this" keyword to get the object that called the method. And when I call "B.Select();" I have to know that the select method was called using the B class (so I can get the class name). Sorry if I wasnt very clear. Any help would be appreciated.
  10. Thanks man!
  11. Cassio

    Open New Form

    You can use target="_blank" on your link.
  12. Hi! If you still have it I want it. ;) vivialvesb@terra.com.br Thanks!
  13. Use this: If reader1.Read() Then vuserid.text = reader1.item("username") & " " & reader1.item(tellernum") vname.text = reader1.item("fname") & " " & reader1.item("lname") End If
  14. The code on the page_load runs before the update function, so when you call the BindGrid() function the datagrid source has already been defined in the page_load. You should put the data access code in the BindGrid() function instead, and call this function from the page_load too.
  15. Yes, it is possible. The internet is full of examples. You´ll find it easily.
  16. Hi, i tried this example and it really has this problem. You can fix it by including "runat=server" in the div control. The problem with this is that if you look at the page's client code you'll see that the div's id has changed to usercontrolname_divCalendar. So the client script will not work this way. My suggestion is to put the client script on the codebehind file and register it on the page. So I changed the code a little bit and its working fine. On the codebehind private void Page_Load(object sender, System.EventArgs e) { //client function System.Text.StringBuilder script = new System.Text.StringBuilder(); script.Append("<script language='javascript'>"); script.Append("function OnClick(){"); script.Append(" if(document.getElementById('" + this.ID + "_divCalendar').style.display == 'none') "); script.Append(" document.getElementById('" + this.ID + "_divCalendar').style.display = ''; "); script.Append(" else "); script.Append(" document.getElementById('" + this.ID + "_divCalendar').style.display = 'none'; "); script.Append(" } </script>"); //Register the client script to the page Page.RegisterClientScriptBlock("CalendarScript", script.ToString()); } private void Calendar1_SelectionChanged(object sender, EventArgs e) { TextBox1.Text = Calendar1.SelectedDate.ToShortDateString(); System.Web.UI.Control div = this.FindControl("divCalendar"); //hide the calendar if(div is HtmlGenericControl) ((HtmlGenericControl) div).Style.Add("display", "none"); } private void Calendar1_VisibleMonthChanged(object sender, MonthChangedEventArgs e) { System.Web.UI.Control div = this.FindControl("divCalendar"); //show the calendar if(div is HtmlGenericControl) ((HtmlGenericControl) div).Style.Add("display", ""); }
  17. Yes. On the code behind, on the page load event you can add a attribute to the button. btn.Attributes.Add("onclick", "MyFunctionName();"); The vcscript function will run before the postback.
  18. Where are you setting the datasource of your dropdownlist?
  19. try cd .. or cd \
  20. If you just want to refresh the page then you could use a viewstate variable to store the ID of the selected group.
  21. Maybe the session state is disabled. Open IIS, on the Default Web Site properties, go to Base Directory tab and click Configuration. Then go to the Options tab. There you´ll see the session state configurations.
  22. try it: Data Source=Igloo;Initial Catalog=dbName;User Id=Domain\User;Password=pass
  23. Thats right.
  24. Make an abstract filter class with the common properties you need and then make all your filters derive from this class.
×
×
  • Create New...