Implementing Custom MappingSource?

Mar 18, 2010

I am looking at implementing a custom MappingSource as side project. It needs to be something along the lines of AttributeMappingSource and XmlMappingSource, except that it won't be using attributes or xml. This has been a problem so far. All the documentation I've seen uses these two, and only these two. I know how to define the new classes and implement the abstract methods, but there are a few problem. Let's take a look at the mapping source first:

public class CustomMappingSource : MappingSource
{
protected override MetaModel CreateModel(Type dataContextType)
{
// it is suggested to create a new metamodel and pass in
// the current metamodel held in the datacontext.
return new CustomMetaModel(GetModel(dataContextType));
}
}

Ok so far, except that it's a new generic context, and no model exists yet. For example, I want to be able to do this:

DataContext = new DataContext(connectionString, new CustomMappingSource());

Now let's look at one of the CustomMetaModel's overriden methods:

public override MetaTable GetTable(Type rowType)
{
// there are no methods or collection exposed in 'this' to
// add, remove or alter the table mappings.
}

How do I do this? as you might be guessing at this point, I am looking into building a FluentMappingSource. NO! Don't point me to FluentLinqToSql. I have it and their mapping source isn't even derived from MappingSource.

View 1 Replies


Similar Messages:

Custom Server Controls :: Implementing An Interface From A Class Library In A Custom Control?

Jul 8, 2010

I'm building an n-tier application, with the web client and the class library separate. I'm also using the factory pattern of development, using interfaces to act as containers for different objects they are associated with. The problem I'm expreriencing is that I declared a public interface class in the class library and I can create an instance of it in in my aspx pages but whenever I declare it in my custom control code-side, i get an error, like so:

Error 20 The type or namespace name 'IContentMaker' could not be found (are you missing a using directive or an assembly reference?)

notge that I have inherited the class library namespace using the 'using' keyword just in case you are wondering. My code is like so:

using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using TQO_Classes ; //importing the class library project
public partial class PageContentMgr : System.Web.UI.UserControl
{
private IContentMaker _data; //this line throws the error, it works fine on aspx pages

View 1 Replies

Custom Server Controls :: Implementing PostBackUrl Feature In A Custom Server Control?

Dec 20, 2010

I've build a custom server control inheriting from WebControl. Basically it is a kind of button. All is working perfectly except one thing: the PostBackUrl is inoperative.

I probably forgot to implement something. Actually I just added the property PostBackUrl. Probably I should also implement an interface of call something.

View 4 Replies

C# - Implementing A Custom Section In The Web.config File?

Jun 19, 2010

I've been working on implementing a custom section in the web.config file for a little something I'm working for the past few hours, but I can't seem to get it working. The following is what I'd like to use as my XML structure:

[code]....

View 1 Replies

Implementing Custom Delete By Adding To My ASPxGridView GridViewColumnCustomButton?

Sep 2, 2010

Im implementing custrom delete by adding to my ASPxGridView GridViewColumnCustomButton.

Then on my GridView I handle ClientSideEvent

<ClientSideEvents CustomButtonClick="function(s, e) { customButton_OnClick(s, e); }" />

JS:function customButton_OnClick(s, e) {
if (e.buttonID == "customButtonId") {
e.processOnServer = confirm("Really want to delete?");[code]....

now on the server side I user linq to delete specified row and then submit changes to my DataContext and then DataBind() on my grid.

Problem is that sometimes standard ASPxGridView loading panel is shown for about 1 second ant then my row dissapears so it behaves properly but sometimes loading panel stops mooving. and I need to move mouse over my grid or click button so that my Grid is updated(row dissapears).

View 2 Replies

Web Config - Implementing A Custom Error Page On An .Net Website?

Jan 29, 2010

I have an ASP.Net website and I want to use a custom error page. I put the following code in my web.config

<customErrors mode="On" defaultRedirect="~/error.aspx">
<error statusCode="404" redirect="~/error.aspx" />
</customErrors>

The problem is when i go to a URL that does not exist is still uses the 404 error page specified in IIS Manager.Question: How can I make it use the error.aspx page I have created? Why do the settings in IIS Manager override the web.config?

View 1 Replies

Implementing OpenId In Custom Application Where Users Are Created By Administrator Only?

Feb 16, 2011

In my asp.net application, users are created by the administrators & those users need to log-in into the system using their own email/password or openid. So what is the best option to implement in this scenario?

I mean, as users can't register them self,do administrator required to associate each openid with the users & what kind of table structure do I need?

And do I also need the log-in interface like that of [URL] showing multiple types of authentication(default & openid from various providers)?

View 1 Replies

Forms Data Controls :: Implementing A Datagrid With Custom Scroll Bar?

Oct 27, 2010

I am implementing a Datagrid with custom scroll bar(tiny scroller using Javascript).

Here the problem is the Header also scrolls.So how can I make it fixed.

I have one solution like following.

function s()
{
var t = document.getElementById("");
var t2 = t.cloneNode(true)
for(i = t2.rows.length -1;i > 0;i--)
t2.deleteRow(i)
t.deleteRow(0)
Headerdiv.appendChild(t2)
}

Here the header is Fixed(almost problem solved).But the Header columns are not in Correct position corresponding to data columns.

View 9 Replies

Forms Data Controls :: Implementing A Custom GridView To Find A Cell By Its Header Name

Feb 9, 2011

I'm trying to implement a custom GridView to find a cell by its name. Here is my class:

[Code]....

how I can implement the SET part of property?

View 3 Replies

Asp - Implementing PHP AES Function In C#

Feb 5, 2010

I have given a task in which I need to encrypt an user's ID using AES encryption, what they want is I need to pass in a parameter in a website just like this.

[URL]
Parameter : ?param= encrypted text

aside from that there was an attched php sample that they want me to follow to encrypt but I don't have an idea on how to convert this one in .NET

function getEncrypt($sStr, $sKey, $sIV){
$sCipher = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sKey, $sStr, MCRYPT_MODE_CFB, $sIV);
return bin2hex($sCipher);
}
$sStr = "13410##13";
$sKey = "mediaservice1234";
$sKey = "kjcemsdev3jangho"; // Do not change
$sIV = "fs0tjwkdgh0akstp"; // Do not change
$tmp= getEncrypt($sStr, $sKey, $sIV);

View 2 Replies

Specify URL When Implementing IHierarchyData?

Jan 30, 2011

I've implemented IHierarchicalDataSource, IHierarchicalEnumerable and IHierarchyData. The TreeView displays everything correctly. But where should I specify the URL that should redirect the user where needed when he clicks on the TreeView's item?

View 1 Replies

Implementing The Logic - Reading Xml

Apr 21, 2010

i have a requirement that i need to download xml file from ftp and store it in a local folder and i have to read the xml and store it in my database. So i need to read the xml file and insert into database as bulk way. not instant insert. so which would the best way?

View 9 Replies

C# - Implementing Web Service With WCF 4.0 With Authentification?

Nov 3, 2010

I am starting development of the new project and since I am new in the WCF world I want to ask your advice.I am going to implement web-service which will provide data for WPF client and for ASP.NET site. Web site and web service should be hosted in the Windows share hosting (not didicated server) and this fact is bothering me. WPF client and web site will provide almost the same functionality for the user, so I want to implement all logic inside web service not to duplicate it in the client and web site. Not sure what is the best way to implement such web-service - REST, SOAP or something else? Please, help me with selecting technology for web-service creation, I just want to get direction for optimal solution. 10x.Update: Sorry I did not wrote details. Service will be something like on-line shop with admin panel, so web service will be used for getting products and for adding new product to the system. It does not support tons of customers, it's just solution for small web-shops.

View 1 Replies

C# - Implementing Search In Web Application?

May 5, 2010

I am implementing an eCommerce application using ASP.Net. I would like to know if custom Google search is sufficient enough or if we plan to go implement our search functionality.. how do we go about doing it?

View 3 Replies

Implementing Clickatell CallBack In ASP.NET Using C#.NET?

Feb 3, 2010

I am building a web application in ASP.NET using C#.NET which sends a SMS using clickatell.I am trying unsuccessfully to receive a status back from clickatell by creating a CallBack Page called ClickatellCallBack.aspx Here is the codebehind of the Page:

public partial class ClickatellCallBack : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)[code]....

Basically, this Page retrieves the Query String values sent from clickatell and inserts them into a database table.I have registered the following Callback URL:

http://www.mydomain.com/ClickatellCallBack.aspx with clickatell and selected the Callback Type: HTTP GET

In my 'sendmsg' command I set delivery acknowledgement and callback request as follows: deliv_ack=1 and callback=3

The only problem being that nothing appears to be happening. The CallBack URL doesn't appear to be reached by clickatell.Do I need to implement this Callback URL using something other than an ASP.NET Page? Is there some clickatell setting I'm missing?

View 1 Replies

Implementing Code For Username Recovery?

Jan 27, 2010

I have the following code where i enable the user to insert their password to retrieve their username.

[code]....

But nothing happens, it doesnt work. I want it to do the check and then do something. I am just testing with a label for the time being.

View 5 Replies

Web Forms :: Implementing Url Re-Writing Into Site

Mar 1, 2011

I've been looking at implementing Url Re-Writing into my site, and have been confused by the sheer magnitude of different methods of doing it!

Anyway, what I'd like to do is convert my existing url into something more readable and search- engine friendly.

For example, my current Url is '~/Magician?localityId=x' (where x = the id of a place name)

and I'd like it to be '~/placename-Magician' (where placename = that retrieved from the querystring)

I use the localityId to query the database with, in order to get the relevant place name.

Does anybody know the best method to use for this, and can you point me in the direction of a good tutorial for that method?

View 7 Replies

Session Management After Implementing Openid?

Aug 16, 2010

i have implemented the the openid in my page using dotnet open id when i get authenticated iam storing the details provided by openid provider in my database and creating a session of that username and redirecting the user to login protected page it is working fine but some time if i left the page idle for some time and then do any kind of postback then the session is lost and my page do not allows me to do any thing as it is login protected some time it is working fine without any problem. can you suggest me why is it so.

View 1 Replies

C# - Implementing A Membership System Using OpenID?

Jan 26, 2011

I'm looking to implement a membership system using OpenID for my ASP.NET application, similar to the system used here on StackOverflow. I'm aware that the OpenAuth library is generally recognized as the way to go, but I'm having trouble figuring out how to implement it.

I use NHibernate to persist my domain objects. I have a Users table with a username column, email column, etc. I'm not sure how to integrate OpenID with my own users table, and I haven't found any good tutorials on this. Does anyone have any experience with this? What is the best way to go about doing it?

View 3 Replies

Implementing Security With Session Variables?

May 5, 2010

I am doing web based projects in dotnet. Currently I am implementing security using session variables. I keep current user id and user type in session and authenticate user from these session variables (say Session["UserId"],Session["UserName"] and Session["UserType"]).

I've heard that such security can be broken and applications can be hacked very easily, like it is possible to get session id and directly connect to that session id etc.

View 1 Replies

Possible To Re-use Master Page From A Winforms App In A New MVC Im Implementing

Aug 9, 2010

We have an app with standard ASP.net forms. I would like to use MVC and I just wondered is it possible to re-use a master page from my main site?

View 3 Replies

Html - Implementing Multilingual Website?

May 8, 2010

I am implementing an multilingual web site using ASP.Net. The languages are English,French and Arabic. Please note that Arabic's direction is RTL. What is the best way to implement the multilingual support. I am planning to use the .Net localization feature but the website texts are stored in DB. For the controls ( form controls) , I can used resx file. Do I need to build two different pages ( one for LTR and another for RTL )? Or can I have one ASPx file for all the three languages?

I would like to hear some best practices in implementing these kind of web applications.

View 1 Replies

Implementing Forgot Password Functionality In Mvc

Apr 3, 2011

I want to implement a forgot-password feature in asp.net mvc that allows users to reset their password, and have some questions in this regard: Lets say that before allowing users to reset their password, I want to verify some extra information such as their first and last name. This info is not stored by default in the table created by aspnet_regsql. What is the recommended approach to address such issues?

Should I store this kind of info in a separate table, and use table joins to verify OR should i modify the schema of the table generated by aspnet_regsql (how?) so that I don't have to use joins? Do I need to write a custom provider OR would that not be necessary? I have read at places e.g. in this post that instead of emailing a temporary password, an alternative is to email a URL that when clicked allows users to change their password. How is this done? How to ensure that the URL expires after 1 hour?

View 1 Replies

C# - Implementing Advanced Filter Page

Feb 10, 2010

I have a page which gives user to generate report based on different filters selected. my thoughts Loop through each filter control (checkbox, multi select list, radiobox list) and build dynamic where conditions and conjunctions for each filter and then run query Get all the data (i think this will causes an overload with all 4-5 tables joined) and then use Linq to filter this data based on user selection Is there a better way to implement this?

View 2 Replies

Security :: AES Example / Implementing AES - Key Not Valid For Algorithm

Jun 21, 2010

I need an example on how to implement AES encryption/decryption in .NET. I've been googling but haven't yet found any good examples. I've for example found AES example whih after some research wasn't 100% AES. I have to make sure by AES encryption/decryption is 100% AES, as I have to send email to the authorities explaining how I use AES (with secret key all), so they can hire some encryption expert which verify that we encrypt/decrypt it correctly. So he can verify that the what I implemented in AES is actually 100%. I'm reading the AES standard and how it's to be implemted in .NET Here is some code I'm having trouble with:

[Code]....

Which throws an CryptographicException: Specified key is not a valid size for this algorithm.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved