.net

access function in aspx page to master page

hello folks., I have a.master and b.aspx . i have some functions in my aspx page. how to access that functions in a.master page. thank you ...

XSLT transform XML with default namespace without adding prefix?

Hi, I am trying to transform an XML file with the following namespace, but could find out a way to make it working with the default namespace without adding a prefix to the output XML. Original XML file: <pExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://workflow.co...

Populate base class along with child class ?

Hello fellows, I have a need where I have to add some new fields to an existing class along with all its existing fields/attributes. So whenever my derived class is filled by DAL, I will be filling all fields of base class as well. Currently, I am doing it like this but not sure this is the right way ? Please give me an example. Also I...

how to create event handler for dynamic drop down list in c# .net

I have created a dynamic grid view using Itemplate .now i have also created a dynamic drop down list in the grid . how to create a event handler for on selectedindexchange . i created a slectedindexchange event but it didnt work .the control never passes to the event ? what to do create a event handler public class DynamicGridViewTex...

.NET Append JSON to a string already serialized with DataContractJsonSerializer

I am using DataContractJsonSerializer to serialize an object to json, and then returning to the client with AJAX. I now need to serialize another object to return along with it. The problem is MSs "d" that wraps around the JSON, that stops me from simply concatenating the strings into a single JSON string. json = json & """,""SecurityGr...

javascript form post submit working in IE but not Chrome

Dynamicaly adding a form to a page and submitting it in c#. Works fine in IE but just realized its not working in chrome. Im doing it as a function of a PayPal Transaction Object I built for a little ecomerce app. Here is the code. private void PayPalPostScriptLONG(Page page) { StringBuilder strScript = new StringBuilder...

Is using Lambda expression for try without catch a bad practice?

I have many portions in code where I do try { // not so important code, but don't want this to affect anything else } catch { } Is using this considered as a bad practice? Try(() => { }); void Try(Action a) { try { a(); } catch { // ignore. } } ...

Clarify some things about IDisposable interface. Is instance (must be) equals null after calling Dispose ?

I have a class which implements IDisposable interface. using System; class A : IDisposable { public void Dispose() { Stop(); // some actions to stop internal threads this = null; } } Why can't I assign this = null in Dispose method ? I know 'this' is read-only. For example: A a = new...

Where/when should i validate my data when using EF and POCOs?

I started a project to see what EF 4 can do with POCOs. I created a db and a custom POCO. Now i want to validate my data. For this i'm using the Enterprise Library Validation Block 5. I have no problem including the validation in my POCOs through attributes and using it with Entity Framework but this means that my POCOs wouldn't be POCO...

One application depending on the other for the domain code

Hello, I am building two applications, one application depends on the code in the other. App1 has a simple domain. And App2 uses this domain to read data from the a database. What is the best way to build this dependency ? Without having problems with namespaces etc. ...

In a struct, is it valid to implement operator== via Equals, but not override Equals and GetHashCode?

Is this valid? public struct MyStruct { public int Foo { get; set; } public static bool operator ==(MyStruct a, MyStruct b) { return a.Equals(b); } public static bool operator !=(MyStruct a, MyStruct b) { return !a.Equals(b); } } (I know it's slightly inefficient because Object.Equals uses...

Making a .NET library in Visual Studio

I am building a library in Visual Studio, and I have decided on my namespace structure as CompanyName.Type.Action e.g. MyCompany.Common.DataFile. In Visual Studio I accomplish this by creating a new solution with name MyCompany.Common and then adding to the MyCompany.Common project the class DataFile. First of all, this leads to the so...

Does F# have equivalent syntax to C#'s "unsafe" block

A lot of array boundary checking slows down the speed, this is especially true to 2D arrays. Is there a way to write unsafe code blocks in F#? ...

Developing webinar project with .NET

I'm researching for an internal webinar project which will be developed with .NET. The software will have multi-user webinar system, recording of the webinars, meeting lead, talking with hand raising and desktop sharing. Are there any servers/platforms which we can use for this project? ...

Problem using Webservice in BLL assembly

Hello All I had create business library and add reference of web service in that because i am calling a webmethod in business layer.Now my problem is when i deploy this application on server then it's giving me error 403,its working fine on local host. My Project hierarchy Main Project BLL(Assembly) DAL (Assembly) BLL and DAL refe...

win forms architecture c#

what would be the recommended way for my main window to communicate with his children when my motivation is that when an action is being made on one child another one action is invoked so who should know who ? shold the children get thier father interface and then on thier on_click give make an action from the given interface 2.shou...

Why stacktrace is not displayed when an exception occurs?

Hi all. I have a problem. My program crashes on start up without any stack trace. The only thing I can see is "Send Report To Microsoft". This happens only on one PC. Can you explain me Why some exceptions are with stack trace and some are without? Thanks. ...

Streaming over WCF using NetTcpBinding

I can successfully use WCF streaming to xfer data from a server to client on the same machine. However as soon as I deploy my server to another machine, I get errors of the nature "A call to SSPI failed: The target principal name is incorrect". Has anyone come across this. I tried to set SecurotyMode.None on both sides but that gave m...

How can i access user infromation using FQL according to email id?

hi... i want to fetch the user information(from facebook) using FQL according to email... select * from user where email='[email protected]' how can i use this in asp.net application through using some API.. (https://api.facebook.com/method/fql.query?query=QUERY.) plz reply kind regards.... ...

Calling simple web service (.asmx file) from AJAX and JQuery using JSON - parse error

Hi all, Making my first steps in trying to use all these technologies together.. I'm having some toubles.. Here is my Server side: [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string simplestMethod() { return "Simplest method returned"; } And here is my client side: $(document).rea...