|
in one word Viewstate
you can still use to controls on an asp.net (not razor version)
MVC does give you the advantage of super light postbacks and responses but has. Where in mvc your information is being contained in the model (which obviously excludes ajax calls creates)
But in my personal opinion asp.net does seem to take more of an object oriented approach to reusing controls , which makes developing massive information system a lot less painful and quicker ; but the tradeoff is a lot of information being parsed back and forth that you are most likely not going to use every time a button is clicked which is bad for high traffic sites.
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
The first thing I have done on any webforms site I've built in the last 15 years is to disable viewstate globally so that it has to be explicitly enabled on any controls that need it. People keep bringing up viewstate as if it is a decisive issue, completely ignoring the fact that it can easily be turned off. People who go to MVC because of "viewstate" are simply bad webforms programmers and they will go on to be bad MVC programmers.
Not a dig at you personally, it just gets my goat when people talk about viewstate as if it was some insurmountable evil.
|
|
|
|
|
Hi
I agree with you completely , what I normally do is put my viewstate in a session to avoid the big back and forth , and if you read my posts you'll find that they are completely pro ASP.Net over MVC
All I am saying is if you are hell bend on squeezing the very last bit of performance out of your app MVC would be the way to go (it would take you way longer to code and you'll most likely get lazy debugging front end code and just start implementing bad practices) but I still prefer ASP.NET using N-Tier Architecture and good practices over MVC any day
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
What does the error - "Source is not available at current location" - means while using ajax controls?
|
|
|
|
|
This happens when the code you are trying to view does not exist in your project. Here[^] is a CP question answered that can help you.
|
|
|
|
|
I suppose have got wavecome M1206B modem device connected to the computer is complete and I have got the information fields (FULLNAME, BIRTHDAY, IDIDENTIFY, ISSUER, DATERANGE, PHONENUMBER, SERIAL) must register for the SIM card, ask syntax register using AT commands in HyperTerminal set of winxp ? after then switch AT Commands above as by as syntax of source code C# ?
|
|
|
|
|
Have you considered asking that in English, instead of just using as few words as possible?
It might help us to understand what the heck you are going on about...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I suppose have got wavecome M1206B modem device connected to the computer is complete, if get the phone number SIM Imel successfully returned number SIM Imel, Status and the error Flag ?
|
|
|
|
|
Have you considered asking that in English, instead of just using as few words as possible?
It might help us to understand what the heck you are going on about...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi for All
I need method convert to bool[] from
1- string[]
for example string[] w;
i need convert w[0] to bool[]
2- byte
for example byte b;
i need convert byte to bool[]
======================================
also how can convert bool[] to byte
thank you for my support
|
|
|
|
|
You can make use of bool.Parse , bool.TryParse or Convert.ToBoolean to do so provided data in these arrays can be converted to boolean .
You will need to loop through each item in array to do so.
|
|
|
|
|
Hi,
thank you sir
sir can be give me example
Regards
|
|
|
|
|
Hi Sir
Sir how can write code to change w[0] to Boolean
w[0]=0xAA;
mean w[0]=10101010;
i need change w[0] to Boolean value mean {true false true false true false true false}
also this
byte kk=0xAA;
mean kk=10101010;
i need change kk to Boolean value mean true false true false true false true false
Regards
modified 29-May-15 1:53am.
|
|
|
|
|
The below statement if (bool.TryParse(var[i], out v))---> says you whether it's really converting/not.if it returns true,then converting else returns false.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string[] var = {"abc","bcd","cde"};
public bool call(string[] var)
{
int i;
bool v;
for (i=0;i<var.Length;i++)
{
if (bool.TryParse(var[i], out v))
return v;
else
return v;
}
return true;
}
private void Form1_Load(object sender, EventArgs e)
{
bool b = call(var);
}
}
Remember it's not possible to convert string/string[] to bool.If tries it threw an exception of type 'System.FormatException',may not terminate the program but threw an exception.
|
|
|
|
|
Hello friends,
I am saving multiple Workitems of type Task but while saving it throws an exception "There is a problem on the server. Contact your Team Foundation Server administrator.
InnerException {"TF400732: The request has been canceled."} System.Exception {System.Web.Services.Protocols.SoapException}
why I am facing this issue? please help me to resolve this.
Thanks
Manoj Kumar
|
|
|
|
|
You given us nothing to work with except for the most generic error message TFS can throw.
Only you know the circumstances under which the problem occurs and there are a ton of possible causes, so start researching what everyone else has run into[^].
|
|
|
|
|
Thanks sir for your reply. Even I know its most generic error. my code is simple like
WorkItemType workItemType = teamProject.WorkItemTypes["Task"];
for(int i=0;i<100;i++)
{
WorkItem task = new WorkItem(workItemType);
task.Fields["somefield"].Value = "somevalue";
task.save();
}
exception comes at task.save. and value of I varies some times 2, some times 4 even some times it reaches 60.
|
|
|
|
|
I have no idea what's causing the problem as I've never done anything in code with TFS.
|
|
|
|
|
I want to calculate the size of the variable and not size of the data type. For example int anyValue=10;
what is the size of anyValue ?
(*Not calculate size of int)
NOTE:-->
So here anyValue size must be less from int datatype size.
|
|
|
|
|
You could do it by a loop that repeatedly right shifts the value until it reaches zero. The number of shifts gives the size.
|
|
|
|
|
Have a read of this Marshal.SizeOf[^]
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
The size of a variable is the size of the type it declared as: so for your example:
int anyValue = 10; the size of anyValue is always 32bits / 4 bytes because an int is a fixed size, regardless of what it contains.
This is even true for reference types: the variable which holds the reference will always be the same size:
Control c = button1; c is a reverence to a Control instance, so it will always be 32 bits or 64 bits depending on your your app is built and running.
The value it refers to can be different sizes in some cases: string, arrays, collections and so on can be variable sized1, but in general even a specific instance of a class will always be the same size. Value type instances are always the same size, they can't vary.
1: Even then, the collection instance is not a variable size, but the data it collects may be - the actual collection of objects is stored as an array of objects which is itself a reference.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi OriginalGriff,
int sizeOfVariable = Marshal.SizeOf('A');
int size = sizeof(Char);
Console.WriteLine("The size using marshal is {0} and SizeOf is {1} ",sizeOfVariable,size);
Console.Read();
Why the two result is different ??? :P
|
|
|
|
|
sizeof vs Marshal.SizeOf[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
This is where is starts to get complicated...
Because a Char is not the same everywhere!
'A' is a char - so it will normally return 2 because a Unicode character takes two bytes (an ASCII character takes one, but nearly all the time in .NET you are dealing with Unicode values)
So the sizeof(char) returns 2 because it needs two bytes of managed memory to store each char.
When you use Marshalling however, it isn't dealing with Managed memory, so it doesn't use Unicode - it uses ASCII instead. Because Marshalling is all about getting ready to talk to external non-NET applications, it can't just pass managed memory directly - because it might have to move it while the other application is using it - so it will effectively prepare a copy of the data in ASCII, because that is the older character standard that most apps used pre-NET.
So sizeof will give you the Managed size - 2
and Marshall.SizeOf gives you the unmanaged size - 1
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|