Jump to content
Xtreme .Net Talk

bri189a

Avatar/Signature
  • Posts

    1014
  • Joined

  • Last visited

Everything posted by bri189a

  1. What does the markup for the aspx page look like? Also if((document.all?true:false)==true) {} else {} is the same as: if(document.all) {} else {}
  2. Glad I could help, and thanks for you thanks...been a bit battle fatigued lately and actually for once hearing some appreciation can do a lot for one's spirits.
  3. Yes, the properties you see at design time are accessible at run time.
  4. Which part helped so much?
  5. Check out codeproject.com - somebody out there I'm sure has written one...I've seen it out there before but have never had the need for it so I've never researched it myself.
  6. Two things 1. Your label should be: <asp:Label id="lblCurrentStatus" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "current_status") %>'></asp:Label> 2. The formatting you are seeing is correct... MyGrid is the parent grid, ctl16 is the generic control for the cell, and lblCurrentStatus is your label, this when going back to the server will be transformed to MyGrid:_ctl16:lblCurrentStatus which I think you may be looking for??? You have to remember these are controls within a naming container and that is why they have this heiarchy. Finally, if getting the label doesn't work you can always doing the following (in the OnItemDataBound event): DataRowView drv = e.Item.DataItem as DataRowView if(drv!=null) { if (drv.Row["current_status"]=="Current") { lblStat.ForeColor = System.Drawing.Color.Blue; e.Item.BackColor = System.Drawing.Color.Aqua; } } Also keep in mind the DataGrid has a SelectItemIndex property that you can use if your just simply trying to keep track of the selected item, then you can set the selected item colors through properties or style sheet.
  7. Well for instance in one application I've worked on a certain user control which had a datagrid was consumed by several pages. This datagrid had the same 8 columns of data for all the pages except for 1 which only had 7 of the 8 columns. The order of the columns was always the same, but processing had in column 2 that were dependant on columns 5 and 7 in all of the pages except for one, where because of that missing column it was columns 4 and 6. So in the control we had a property called ColumnOffset which looked something like so: Public ReadOnly Property ColumnOffset As Integer 'This is more psuedo code than anything If Me.Page.HasSpecialItem Then Return 0 Else Return 1 End If End Property Then in the OnItemDataBound event we had something similiar to: e.Item.Cells(0).Text = SomeGenericFunction(e.Item.Cells(5 - Me.ColumnOffset), e.Item.Cells(7 - Me.ColumnOffset)) This SomeGenericFunction would evalute the content of the cells and return necessary text, but the point is that by using this ColumnOffset variable, regardless of number of columns shown we were able to get the information we were looking for. Now this might be exactly what you need, but it's the kind of 'variable' type of thinking that I was eluding to.
  8. Instead of using 4 you could use a variable. or Instead on text in the cell you could have a label, give it an id then use FindControl.
  9. If you are refering to server side: MyCell.Controls.Add(MyRadioButton)
  10. like so: <a href="whatever.aspx" onclick="MyFunction(); return false;">Text</a> The return false keeps anything else from happening.
  11. Because the #include will spawn the old ASP engine if I remember correctly. Not to mention it's a maintnance nightmare... it's just bad practice to mix classic ASP with ASP.NET and there are some mentions of it out there being a performance hit. This is how you load a user control dynamically: Preferably you have a place holder control, or a panel, or somewhere to load it specifically. Then: Me.MyPlaceHolder.Controls.Add(LoadControl("~/Folder/Control.ascx")) or in C#: this.MyPlaceHolder.Controls.Add(LoadControl("~/Folder/Control.asxc")); MyPlaceHolder in this example represents a place holder control already on the form. Use any control you'd like that allows controls to be added. If these weren't dynamic controls you'd just drag them on the form and designer from the solution explorer.
  12. If this is an ASP.NET site you shouldn't be using in includes, you should be using user controls that are easy to add dynamically.
  13. Why wouldn't you do it initially? I don't see why you couldn't.
  14. Well the 3rd party that you got the WYSIWYG editor (rich text editor as you call it) should provide some documentation that would provide that information. More than likely it's probably a .Text property or something. Check your support options and call them if nothing else.
  15. Are you saying it's treating a 0 as a number instead of a string? Perhaps if the CSV data had quotes around it: '000073' instead of 000073 may work to tell whatever is determining the column type that it's a string, not a number data type? Just a thought.
  16. They do not have to be the exact same structure, the things that have thrown off my merge before is the table name not matching or the column name (unbelievably so) not have the same case in one as in the other. The field length, prescion, default values may be a source too...Merge I've found isn't very forgiving. I've also had better luck with strongly typed datasets merging then 'on-the-fly' datasets.
  17. What makes you say its more stable?
  18. I'm on an ASP 3.0 project right now and need to integrate a library (business) functions for use with this ASP 3.0 web site. I checked the 'Register for COM interop' on the build and put in all the necessary attributes...everything initially worked great...our old ASP 3.0 application was playing happy with a .NET dll. Then we went to make changes. We recompiled and no changes were detected in ASP application - long story short it was still using the old dll. I manually went in with regasm and put in the dll with /u and /tlb arguements and it came back with the successful message for un-registering. From experiance I went to delete the .dll and .tbl (and also the debug file) and they were locked. I stopped IIS, ran the regasm command again, and still the file was locked (access denied/in use). I tried stopping the DLLHOST.EXE process that ASP was running on and of coarse that gave me access denied. Obviously I'm missing an important step here and I curious if anyone has run into it before and how to get around it. I have to make sure that a process will always actually uninstall and delelte the dll/tlb and install the new (correct/updated) ones for change management...rebooting web servers is not an option (to release the locks) and it is too large of a project to retro-fit to .NET. So I'm hoping someone out there has some good advise...I've Google'd and spent a lot of time on MSDN and everything say the regasm with /u switch should work...but then there examples are VB6 project and COM projects...not ASP. Thanks in advance for any help.
  19. For your error you need to get your datasource first in your pager sub routine: dg.DataSource = Catalog.SP_GetInfo() dg.CurrentPageIndex = e.NewPageIndex dg.DataBind()
  20. For those of you interested, this handles testing the ASP.NET server side logic: http://nunitasp.sourceforge.net/
  21. I'm looking for a unit tester to do my presentation layer. I currently use NUnit to test my business and data access layers, but I need to be able to regression test the GUI easier...does anyone have any free suggestions that would itegrate with NUnit or another 'free' tool that works well?
  22. Well I've never had Excel hang in the process' after I started coding down that road with Office applications, so that old version may not be very clean, but it did the job consistently and I never had a problem with Marshal.ReleaseComObject().
  23. You are correct on that...I was thinking of a past experiance where I had to add multiple items to a single attribute so I was doing += on the attribute had to make sure I hadn't already added a particular function somewhere else (had some crazy business rules that were a nightmare to code around). Thanks for the clarification. Just ignore that particular if statement it should read as: //Ensure you've wired up this event of coarse! private void CustomerList_PreRender(object sender, System.EventArgs e) { CustomerList.Attributes.Add("onchange", "openWindowWithValue('http://www.newegg.com/somepage.aspx?id=' + this.value)"); }
  24. I conquered that darn beast a while ago...the secret lies in how you create the references and destroy them (that's some old code of mine on this post, so please over-look the glaring bad coding, the 'what's between the lines' is the important part) - the thing is to never talk to strangers: object cell = myWorkbook.Sheets[1].Cells[2] or whatever the exact syntax is will cause issues. Whereas if you have object tempSheets = myWorkbook.Sheets; object tempSheet = Sheets.Item(1); object tempCells = tempSheet.Cells; object cell = tempCells.Item(5); and clean up the resources with 'ReleaseComObject' you won't have any resources, but now that I'm thinking about it I think all you really have to do is set the items to null and just do the ReleaseComObject on the ExcelApp itself...think I discovered that long after I wrote that (beginner) class. I have some current day code that does all of this somewhere at work, if I have time I'll see if I can't figure out where I buried it... I really need one of those library tracking tools! http://www.xtremedotnettalk.com/showpost.php?p=407231&postcount=7 Hope it helps!
  25. I think you'll find if you follow PD's suggestions you'll have an easier time figuring out how to do what you want to in the future without having to ask because it's follows a more logical path and it will allow you to see the overall picture better, not to mention support down the road for the person who didn't write the code will be easier and if you have to revisit it 6 months from now it will be easier (believe it or not) for you too. Critques are a good thing, don't knock them.
×
×
  • Create New...