|
Thank you!
Get result as your reply.
|
|
|
|
|
You're welcome.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi
In my page i write like this:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",true);
But no popup window open ..is this right code?
|
|
|
|
|
Try following code.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",false);
You were supplied last argument as true, which denotes that it will add script tag automatically.
While you already provided script tag.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
I tried making last argument false as well but it still not giving the popup block
|
|
|
|
|
Are you trying to get that script executed when the page is sent back to the browser??
This question should really be asked in the ASP.NET forum.
|
|
|
|
|
Do You have AJAX Script Manager in your web page. If you then you need to use ScriptManager.RegisterClientScriptBlock .
|
|
|
|
|
ScriptManager is not necessary to inject script blocks into the page, even if you are using Ajax.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: ScriptManager is not necessary to inject script blocks into the page, even if you are using Ajax.
Agree Mark.
I just asked him to check if he has used scriptmanager then he need to use scriptmanager.register..
Yes, this is not necessary. But It can be used.
|
|
|
|
|
Is there a way to see the metadata of the assembly file ?
|
|
|
|
|
Use a tool called ILDASM.
Quidquid latine dictum sit, altum videtur.
Whatever is said in Latin sounds profound.
|
|
|
|
|
You can view it using this[^] Tool.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi everybody. Please I want to develop any type of website using the .NET Framework. I have the software installed on my notebook. Thanks and hope to receive a feedback sooner.
|
|
|
|
|
This[^] would be the best place to start.
It's time for a new signature.
|
|
|
|
|
Sean has done a very good job by compiling all the good resources for web development together.
So, check it out: Beginner's Walk - Web Development[^]
I am sure, it will help you.
..Go Green..
|
|
|
|
|
Following is the best link to get started with Asp.NET.
Get Started[^]
It covers following points.
1. What is ASP.NET?
2. Download ASP.NET and Visual Studio Express Tools (FREE)
3. Build your First ASP.NET Web Application
4. Follow a Step-By-Step ASP.NET Tutorial
5. Learn More about ASP.NET
6. Host your ASP.NET Web sites on the Web
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
I have the task of deserializing objects from a binary formatter that were serialized using VB.Net's binary formatter. The ONLY issue I have come across is that the original class had a field, the same name as the class
structure MyName
...
dim MyName as String
end structure
In VB, this was apparently find, but in C#, I cannot write the class this way. I've rewritten it so that
struct MyName
{
...
string myName
}
but now the deserialization fails (because, I assume, the field name has changed). I have ONLY changed the name of the attribute. I guess this is enough to throw off the deserialization.
Is there away that I can fix this dynamically, or should I resort to the binary reader and parsing the binary file manually?
Thank you for any considerations you could throw my way.
Dave
|
|
|
|
|
I'm not sure it can be solved at all, but if it does, it probably will be based on SerializationBinder . Start Googling!
|
|
|
|
|
hi,
it might help using Attributes for Serialization like i.e.:
<br />
struct MyName<br />
{<br />
[XmlElement("MyName")]<br />
string myName;<br />
}<br />
|
|
|
|
|
Go back and read the OP again. He's using binary formatter, not XML.
|
|
|
|
|
ups my fault ^^
|
|
|
|
|
Hi guys, has anyone come across any scenario wherein you needed to merge one object with another object of same type, merging the complete object graph.
for e.g. If i have a person object and one person object is having first name and other the last name, some way to merge both the objects into a single object.
public class Person
{
public Int32 Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class MyClass
{
Person obj1 = new Person(); obj1.Id=1; obj1.FirstName = "Tiju";
Person obj2 = new Person(); ojb2.Id=1; obj2.LastName = "John";
obj1.MergeObject(obj2);
obj1.Id
obj1.FirstName
obj1.LastName
}
I had come across such type of requirement and I wrote an extension method to do the same.
public static class ExtensionMethods
{
private const string Key = "Id";
public static IList MergeList(this IList source, IList target)
{
Dictionary<string, object> itemData = new Dictionary<string, object>();
string temp = null;
foreach (object item in source)
{
temp = GetKeyOfRecord(item);
if (!String.IsNullOrEmpty(temp))
itemData[temp] = item;
}
foreach (object item in target)
{
temp = GetKeyOfRecord(item);
if (!String.IsNullOrEmpty(temp) && itemData.ContainsKey(temp))
itemData[temp].MergeObject(item);
else
source.Add(item);
}
return source;
}
private static string GetKeyOfRecord(object o)
{
string keyValue = null;
Type pointType = o.GetType();
if (pointType != null)
foreach (PropertyInfo propertyItem in pointType.GetProperties())
{
if (propertyItem.Name == Key)
{ keyValue = (string)propertyItem.GetValue(o, null); }
}
return keyValue;
}
public static object MergeObject(this object source, object target)
{
if (source != null && target != null)
{
Type typeSource = source.GetType();
Type typeTarget = target.GetType();
if (typeSource != null && typeTarget != null && typeSource.FullName == typeTarget.FullName)
if (typeSource.IsClass && !typeSource.Namespace.Equals("System", StringComparison.InvariantCulture))
{
PropertyInfo[] propertyList = typeSource.GetProperties();
for (int index = 0; index < propertyList.Length; index++)
{
Type tempPropertySourceValueType = null;
object tempPropertySourceValue = null;
Type tempPropertyTargetValueType = null;
object tempPropertyTargetValue = null;
if (propertyList[index].GetIndexParameters().Length == 0)
{
tempPropertySourceValue = propertyList[index].GetValue(source, null);
tempPropertyTargetValue = propertyList[index].GetValue(target, null);
}
if (tempPropertySourceValue != null)
tempPropertySourceValueType = tempPropertySourceValue.GetType();
if (tempPropertyTargetValue != null)
tempPropertyTargetValueType = tempPropertyTargetValue.GetType();
IList ilistSource = tempPropertySourceValue as IList;
IList ilistTarget = tempPropertyTargetValue as IList;
if (ilistSource != null || ilistTarget != null)
{
if (ilistSource != null)
ilistSource.MergeList(ilistTarget);
else
propertyList[index].SetValue(source, ilistTarget, null);
}
else if (tempPropertySourceValue != null || tempPropertyTargetValue != null)
{
if (tempPropertySourceValue != null)
tempPropertySourceValue.MergeObject(tempPropertyTargetValue);
else
propertyList[index].SetValue(source, tempPropertyTargetValue, null);
}
}
}
}
return source;
}
}
However, this works when the source property is null, if target has it, it will copy that to source.
IT can still be improved to merge when inconsistencies are there e.g. if FirstName="Tiju" and FirstName="John"
Any commments appreciated.
Thanks
TJ
|
|
|
|
|
Hi,
How does .net framework automatic updates?
Does windows update actually checks/updates .net framework or any .net application actually check any checks/updates?
I have .net application hosted via click once. On certain sites, the application is using lots of bandwidths (I guess it might checks for any updates!).
Thanks,
Divyesh
|
|
|
|
|
divyesh1432 wrote: How does .net framework automatic updates?
If configured, Windows Update will do the framework updates for you.
My signature "sucks" today
|
|
|
|
|
divyesh1432 wrote: I have .net application hosted via click once. On certain sites, the application is using lots of bandwidths (I guess it might checks for any updates!).
Unless you specifically programmed your application to check for updates this is very unlikely to be the cause of the high bandwidth. Also, as far as I know, the .NET Framework is incapable of checking for updates. Windows itself does the checking.
So any high bandwidth usage in your application is due to the way it has been coded.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas? - Because 31 Oct = 25 Dec.
Business Myths of the Geek #4 'What you think matters.'
|
|
|
|