473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using Functions

39
Hi

I have given the If statement under the save button click event as

Expand|Select|Wrap|Line Numbers
  1. if (ThemeDropDownList.SelectedValue == "Blue")
  2. {
  3.             empty.Attributes.Add("BgColor", "blue");
  4.             Save.CssClass = "ButtonIE1";
  5.             ClearButton.CssClass = "ButtonIE1";
  6.             HtmlTableCell WebBody = (HtmlTableCell)Master.FindControl("row1");
  7.             WebBody.Attributes.Add("BgColor", "blue");
  8. }
  9. else
  10. {
  11.             empty.Attributes.Add("BgColor", "#518643");
  12.             Save.CssClass = "ButtonIE";
  13.             ClearButton.CssClass = "ButtonIE";
  14.             HtmlTableCell WebBody = (HtmlTableCell)Master.FindControl("row1");
  15.             WebBody.Attributes.Add("BgColor", "#518643");
  16. }

If I put this into a function then what would be a return type. If the function I specified is correct

Expand|Select|Wrap|Line Numbers
  1. protected void InsertDoctorSettingDetails()
  2. {
  3.  if (ThemeDropDownList.SelectedValue == "Blue")
  4.         {
  5.             empty.Attributes.Add("BgColor", "blue");
  6.             Save.CssClass = "ButtonIE1";
  7.             ClearButton.CssClass = "ButtonIE1";
  8.             HtmlTableCell WebBody = (HtmlTableCell)Master.FindControl("row1");
  9.             WebBody.Attributes.Add("BgColor", "blue");
  10.             }
  11. else
  12.         {
  13.             empty.Attributes.Add("BgColor", "#518643");
  14.             Save.CssClass = "ButtonIE";
  15.             ClearButton.CssClass = "ButtonIE";
  16.             HtmlTableCell WebBody = (HtmlTableCell)Master.FindControl("row1");
  17.             WebBody.Attributes.Add("BgColor", "#518643");
  18.            }
  19. }


is this right
Sep 30 '08 #1
2 1002
Curtis Rutland
3,256 Expert 2GB
I'm not sure at all what you are asking.

Please clarify.

Also, please remember to use [code] tags when posting any code.
Sep 30 '08 #2
r035198x
13,262 8TB
According to your function, the return type is void (read that as nothing). Did you want the function to return something?
Sep 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: hokiegal99 | last post by:
A few questions about the following code. How would I "wrap" this in a function, and do I need to? Also, how can I make the code smart enough to realize that when a file has 2 or more bad...
4
by: Christian Christmann | last post by:
Hi, I'm reading "C++ Coding Standards" by Herb Sutter. On page 67 there's an example which I don't understand: --------------------------------- class Base{// ... virtual void Foo(int);...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
2
by: Henry | last post by:
Hi guys, I want to write some global functions which can be called from different asp.net page. In Visual Basic, there is a global module which allow me to do that. In Visual Basic .net, I...
11
by: Brent Ritchie | last post by:
Hello all, I have been using C# in my programming class and I have grown quite fond of C# properties. Having a method act like a variable that I can control access to is really something. As...
5
by: serge | last post by:
Is it generally or almost always better to have multiple small SPs and functions to return a result set instead of using a single big 1000+ lines SP? I have one SP for example that is 1000+...
39
by: Mark Odell | last post by:
I've always declared variables used as indexes into arrays to be of type 'size_t'. I have had it brought to my attention, recently, that size_t is used to indicate "a count of bytes" and that using...
12
by: BDowling | last post by:
Hi all, I have an existing Visual C++ project that builds a DLL (not COM or ATL or anything). I wish to use this DLL in a Visual Studio 2005 C# project without having to define each function and...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
3
by: David K in San Jose | last post by:
I'm using managed (CLR) C++ in VS2005 to create a Windows app that contains a form named "MyForm". In the code for that form I'm trying to invoke some static functions by using an array of function...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.