0

Gridview and detailsview app: the select statements, aspx.cs codes, etc of the old program were auto generated from Visual Studio wizard. Now, they are asking to add another column to the select statement and a drop down box for this column in the existing detailsview. How do I update it?

By manually typing and inserting the new code to the existing files, or by using the Visual Studio wizard to re-generate the old code with new requirements? Will I lose the old author initials and comments because it will auto-regenerate all code?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ann
  • 1
  • 1
  • Whichever way makes you happy. – mason Jul 20 '18 at 00:08
  • Thanks Mason. But what do companies usually have as standards in modifying ASP.NET programs? What is the easiest and safest method on modifying auto-generated codes in ASP.NET? – Ann Jul 20 '18 at 02:47
  • There is no golden standard. Everybody does everything differently. As far as safest, well you should be using source control, so technically everything you do should be safe. If you screw up, just roll back your changes. Easiest is highly dependent on the user. I will say this however: I don't know of any professional programmer that likes having wizards generate their ASPX markup. And if I was interviewing a candidate that used such a wizard to generate their markup.....I'd be highly doubtful about their productivity and how well they know what they're doing. – mason Jul 20 '18 at 16:56

1 Answers1

0

You now have a choice, do you want to code the HTML pages or stick to drag and dropping control. For consideration, you cannot drag and drop javascript code and certainly cannot use drag and drop control to create MVC's View.

Or your real question is how to put drop down on gridview ? See here

  • On drop down, it is easier to drop and drag because it will not alter the old codes but just add the new generated codes I think. – Ann Jul 20 '18 at 03:15
  • Thanks Adinugraha. On drop down, I think it is easier to drop and drag because it will not alter the old codes but just add, I think. Am I correct? Now, for Select statement if I use the wizard then it may alter the auto-generated codes like the connection,may also loss the author's comment or initials from the old codes etc. moreover, if sorting and add optimistic concurrency are also needed to this requirements. So, on select, sorting and optimistic concurrency changes, what is the best and easiest way to maintain the existing auto-generated codes? – Ann Jul 20 '18 at 03:29
  • Well if it works for you go for it. If there is anything else you still feeling in doubt do tell me. – Adinugraha Tawaqal Jul 20 '18 at 03:30
  • All things you do in wizard is going to turn to code and even saved in form of code. what you see in design view is visual studio run the html code to make the view. – Adinugraha Tawaqal Jul 20 '18 at 03:31
  • in simple term what ever you do in wizard or drag and drop is the same thing you can do in code. In fact some feature run only in code like manual binding. – Adinugraha Tawaqal Jul 20 '18 at 03:33
  • Will it matter if I loss the old author initials or comments because it will auto-regenerate all codes? Maybe, I'll auto-regenerate them then insert by copy and paste the newer generated to the old generated code? What are the companies' standard on ASP.NET auto-generated code changes? – Ann Jul 20 '18 at 03:36
  • When you run the wizard again, it will auto generate the code again. Code that added outside the wizard will most certainly be replaced. – Adinugraha Tawaqal Jul 20 '18 at 03:38
  • For the company standard I know nothing about your Company Standard. But you need to ask the old author before you, what they do? do they code or drag and drop? I suggest follow what they do. – Adinugraha Tawaqal Jul 20 '18 at 03:40
  • Will the companies not like it then because I loss the old authors name or initials and comments? What do companies ask to do? – Ann Jul 20 '18 at 03:40
  • Ann, I'm not the Company employee so you cannot ask it here, you need to ask the Superior on Your Company. – Adinugraha Tawaqal Jul 20 '18 at 03:42
  • In your company, what is the standard on this maintenance situation? – Ann Jul 20 '18 at 03:45
  • My Company use code most of the time. Can't do it on wizard only. – Adinugraha Tawaqal Jul 20 '18 at 04:23