Posts

asp.net mvc - View Models (ViewData), UserControls/Partials and Global variables - best practice? -

I'm trying to understand a good way of 'global' members (like current users, themes, etc.) All of my partial As well as in my thoughts. I do not have to be a logic that can return this data (like BL.CurrentUser) I think it should be a part of the model in my thoughts so I inherited these members from BaseViewData tried. In my controllers, in this way or some other (in a filter or base method in my BaseController), I make an example of an inheriting class and pass it as a visual data. Everything is perfect right up to this point, so my view data is available on the main view with base views. But what about partial? If I have a simple partial that needs to be displayed in a blog post, then it looks like this: @ control language = "C # "AutoAventWireUp =" True "Inheritance =" Viewer Control "& Gt%; And in my opinion, this is a simple code for partially presenting (this is its model. Posts IEnumerable ): & lt;% exotic (...

.net - Check RabbitMQ queue size from client -

Does anyone know that there is no way to check the number of messages in the rabbit MQ que from the client application? I am using .NET Client Library. You can actually get it by the client. When the queue_declare operation is done, the subtitle consists of three toupals containing (& lt; queue name & gt;, & lt; message count & gt ;, & lt; consumer count & gt;) Gives . The Dormant argument for Queue_declare tells you whether the queue server exists without modifying the state or not. You can check the length of qe using the disable option from queue_declare . Not sure about .NET, but something like Python appears: names, jobs, consumers = chan.queue_declare (queue = queuename, passive = true)

javascript - Is there a way to detect a click anywhere on a page except for a certain region? -

This is my problem, I am preparing a website that lets you click on that list to select a specific item Using the OnClick attribute allows me to be able to deselect the item by clicking anywhere on the page. I changed my code to & lt; Body onClick = "unselected ()" & gt; , but again if I click anywhere on the page, it cancels my item (even when I click to choose it for the first time!). So is there a way to find out that the user has clicked somewhere else on my list in the list? Thank you very much. EDIT: I tried on Blur and with the handleClick mixed result when I click on the item that I want to choose, then select it and uncheck it immediately by selecting it. Onblur is not going to cut it because it is not a standard HTML input element. You want to see that this when the onclick event is called. If this refers to an item in your list, you can select the item in the list. If it is referenced outside of the list, deselect all items in your list. ...

jquery post to php call back problem -

This is killing with jQuery When I click the user on the dib layer, I am trying to show a set of results of DB, the function reaches, but the results of the PHP file in the DP results will not return. any idea? & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('# clickme'). Click (function () {// alert ('clicked'); $ .get ("doquery.php", {id: 1, Action: all}, function (result) {$ ("# result"). Html (results);});});}); & Lt; / Script & gt; & Lt; Div id = "clickme" & gt; Show results & lt; / Div & gt; & Lt; Div id = "result" & gt; & Lt; / Div & gt; I suspect that the PHP page returns an error of some type $ . The callback of is successfully executed ("200 OK"). To execute callback on all types of HTTP response status values, enter the code> $ Ajax () .

notepad++ - Regex to change to sentence case -

I am using Notepad ++ for some text replacement in the 5453-line language file. The format of the file's rows is: variable.name = Variable value here, it is certain, indeed Double apostost is deliberately. I need to change the value in terms of sentence, except "here" and "really" words that are appropriate and should be capitalized. As you can see, the case usually starts within the price. I have worked on it for a while. I have yet to get: (.) ([AZ]) (. +) . The replacement piece is where I am struggling. The function on resuscitation replacement matches (such as capitalization) can not be executed. You have a script, for example in PHP or Javascript Perhaps another editor lets you do this, I have not seen this feature yet. Update: View Jonas' answer. I have made myself a web Go to "Find, regexp & replace" (or press Ctrl ) + Shift + F ) Enter your regex (my ^ (. *? \ = \ S * \ w will be) Check the ...

asp.net - How to create a database driven login system -

I want to create a website that the login system should not be controlled by cookies, but (a) table) in local (On server) SQL DB Is there any way to do this? There is even no partial way? Where else will I save instead of cookies ??? ASP.NET uses session cookies by default to track user requests if you If you use cookieles sessions, then you know that session ID has been added to all requests from the browser. In many scenarios, this can also be unacceptable. Even if you decide to hit and check the database for the "login in" flag on each request, you still have some ways to identify the incoming request It is necessary that a particular user may be in the form of encrypted values ​​in the hidden areas based on your security scenario, he said, it is not a better way of using cookies, because any Eta, which is likely to alter the division of customers. Personally, I think the cookies are great for tracking user requests, as long as you encrypt them properly....

html - How to implement a drag-and-drop div from scratch with JavaScript? -

This should be a combination of CSS and JavaScript. The steps to do this should be: Make it at the top of all other elements (Which property specity?) It is clicked Hold the event ( jQuery paths: View addons and. Hundreds of hours have been invested in the jQuery framework Complex tasks like this look C is trivial Chuck Norris' path: If you insist on trying to do it with java JavaScript, then we'll be programming programming for all rich cross-browser applications. Take advantage of the efforts of the jQuery team to make it easy. If you want to do some things, one programmatically sets all draggable items in a relative / full position. If you click on a particular item , It has a top / left value in the CSS to reflect changes made by the X, Y axis of the mouse until the click is released. Tutorial: Additionally, you want to update the z-index of each dragable when it is brought to view it. Tutorials: