I'm wondering if I'm going to store some data into the session is it going to be there while the user is authenticated (using formsauth) or might happen that the data will suddenly go null
Cache.Insert("lstDownload", GetListDownload(), null, DateTime.Now.AddDays(1), TimeSpan.Zero);
when will cache be exprired?
what will we receive when cache expired?
http://stackoverflow.com/questions
Hi,
I'm using godaddy shared hosting, with IIS7, Integrated mode, and published up a bog standard MVC2 app to dev.lazygekko.com created with Visual Web Developer 2010.
It all works, however when any of the links are clicked, they point to dev.lazygekko.com/dev/..., dev being the folder it is pointing at.
Can anyone shed some light on what I may be doing wrong?
Many thanks.
I'm building a simple client-server chat system.
The clients send data to the server and the server resends the data to all the other clients. I'm using the TcpListener and Network stream classes to send the data between the client and the server.
The fields I need to send are, for example: name, text, timestamp, etc. I separate them using the ASCII character 29.
I'm also using ASCII character 30 to mark the end of the streamed data.
The data is encoded with UTF8..
Is this a good approach? Will I run into problems? Are there better methods?
UPDATE:
Probably my question was misunderstood, so I explain it better..
Suppose to have a list of data to send from client to server, and suppose to send all the data in only one stream, how do you send these data?
Using a markup
Using a character as a delimiter
Using a fixed length for every fields
I'm using Entity Framework for creation of my Data Access Layer and I want for all of my classes to be internal.
I know it is possible to manually assign it manually in the designer for each class. But looks like it also requires to set internal modifier for each single property in every class! I have about 30+ entities and it will be a huge work to do.
Do you know any ideas how to set a 'default access' for the entire model?
I want to connect my Table adapter with the Oracle, for that I am preparing a sql query with the query builder. The query which is running fine in Oracle but makes syntax error with query builder.It shows unable to parse the query text. I am using case statement and joins within the query.
CONTROLLER
public ActionResult Index()
{
GroupRepository grouprepository = new GroupRepository();
ViewData["Group"] = grouprepository.FindGroups();
return View();
}
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %
<% foreach (Group i in ViewData["Group"] as List)
{ %
" checked="checked" /
<% } %
The thing is that it is not able to find group id and displaying the following error. What is the solution?
CS1061: 'System.Text.RegularExpressions.Group' does not contain a definition
for 'int_GroupId' and no extension method 'int_GroupId' accepting a first
argument of type 'System.Text.RegularExpressions.Group' could be found
(are you missing a using directive or an assembly reference?)
Hi, I'm wondering about one thing - let's assume that the user clicks a button, and the asynch controller's action is invoked. What happens, when the asynchronous action takes e.g. 10 seconds? The user has to wait 10 seconds to view the result of the action? If so, are the asynch controllers really helpful ?
In the good old days of C. I could cast a float to an int (assuming 32 bit system), do some bit manipluation ( bitwise and, right shift, ect ), and get the upper and lower 16 bit hex representations of the floating point number, which I could then store in two short values. I'm not seeing an easy way of doing this in C#.
System.Convert.ToUInt16 just does a float to int convert (even after I shift right), which leaves a vlaue of 0 if the float is less than 0, which is not the desired effect.
//useless leaves me witg a value 0f 0
UIN16 s1 = (UInt16)((System.Convert.ToUInt32(d2) & 0xffff0000) >> 16); //capture the high word
UInt16 s2 = (UInt16)(System.Convert.ToUInt32(d2) & 0xffff); //capture the low word
A basic cast (UInt32) doesn't work either.
I would like to use the IEnumerable function Intersect() to combine a few list and get the similar integers from each list. The problem I'm faced with is that I don't know how many list I will need to compare.
Here is an example:
A{1,2,3,4}
B{1,2,3}
C{1,2}
results = A.Intersect(B).Intersect(C)
This works great, but the next time around I may have a D{1,2} next time I come across the function.
I'd like to use the Intersect method, but I'm open to new ideas as well.
using :
Dim a As [Assembly] = [Assembly].LoadFile("C:\test.exe")
Dim testTP As Type
testTP = a.GetType("SplashScreen", True, True)
obj1 = Activator.CreateInstance(withoutFOR)
obj1.show()
my prog made reflection to test.exe SplashScreen loaded , also obj1 filled
when SplashScreen disposed - MainForm loaded the obj1 isnothing!
when try to access obj1 VS say :
AccessibilityObject = {"Cannot
access a disposed object. Object name:
'SplashScreen'."}
I want always obj1 filled from the active form!! how????
I am working on a MVC web form where user will submit the Album information in the first step, after submitting the Album information in the second step user can submit the track information data.But i am little confused how i ll do in MVC , in normal webform it is easy for me to do .I am looking for some sloution for this.
i have uploaded my site on hosting server with name www.selectionfurnishing.com
but when i try to open any page i got an error that the site does not exits
when i try www.selectionfurnishing.com/default.aspx then it gives error that the page does not exits (404)
please tell me how can i solve this ....
Thanks
I currently have a function that gets some data from the database and puts it into a dataset. The return type on my function is GenericCollection (Of CustomerDetails)
If I do this:
Dim dataset As DataSet = Read(strSQL.ToString) 'Gets Data from DB
What's the most efficient way to map the dataset results to an collection of objects. More importantly, since I'm using GenericCollection, is there a way to do this in which I can call a function from the ObjectType class (CustomerDetails) that would have a means to converting that specific object.
Or is there a way in which I can use a function that would handle all types?
Is there a way to do something like:
Return returnedResults.TransformDataSet(dataset)
In which returnedResults is an object collection Of CustomerDetails, or would it simply be easier to have TransformDataSet return an object collection Of CustomerDetails by itself?
Thanks for any help.
When a user clicks a button I need to create a .bmp file on the server. After the .bmp file is created I will load it into the html page. Would Ajax be the best way to accomplish this?
How should I go about this? I mean how does the control know whether someone is logged in or not? Session ID? Cookies?
Recommendation of which one I should implement? A guide or tutorial would be appreciated.
My view uses ModelX to render my HTML form and my controller action takes ModelY as input when saving the form. It seems the typesafe textbox API assumes I am using the same model in both places.
Is it possible to use different models and beeing type safe without creating my own helpers ?
<% = Html.TextBoxFor(x => x.Text) %>
I would like something like this. Does it exist ?
<% = Html.TextBoxFor<InputModel,OutputModel>(input=>input.Text, output=>output.SomeOtherText)
Hi,
I am developing a web page in which a rad grid displays the list of exams. I included a template column which shows count down timer when the exam is going to expire.
Code is as given below:
<telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="false">
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn HeaderText="template" DataField="Date">
<ItemTemplate>
<script language="JavaScript" type="text/javascript">
TargetDate = '<%# Eval("Date") %>';
BackColor = "white";
ForeColor = "black";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js" type="text/javascript"></script>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
I am giving DataTable as datasource to this grid. But my problem is , the template column is showing data only for the first record and the value taken is from the last row in the DataTable.
For Ex: If I give data as given below, I can see 3 records but with only the first record displaying the counter with last value(10/10/2010 05:43 PM).
02/02/2011 01:00 AM
08/09/2010 11:00 PM
10/10/2010 05:43 PM
Could you please help in this??
Thanks,
Mahesh
I am using Ajax.BeginForm to post comment.
How should I update the Comments section area to incorporate this new comment?
I am displaying comments on the page using the typical "foreach(Comment comment in Model.Comments)"
I have a class isSearching with a single boolean property in a 'functions' file in my webapp. On my search page, I have a variable oSearchHandler declared as a Public Shared variable. How can I access the contents of oSearchHandler on other pages in my webapp?
Code with Session....
'search.aspx
Public Function oSearchString(ByVal oTextBoxName As String) As String
For Each oKey As String In Request.Form.AllKeys
If oKey.Contains(oTextBoxName) Then
Session.Add("searching", True)
Session.Add("search-term", Request.Form(oKey))
Return Request.Form(oKey)
End If
Next
Return ""
End Function
'theMaster.master
<%
If Session("searching") Then
%><ul style="float: right;">
<li>
<div class="gsSearch">
<asp:TextBox ID="searchbox" runat="server"></asp:TextBox>
</div>
</li>
<li>
<div class="gsSearch">
<asp:Button ID="searchbutton" runat="server" Text="search" UseSubmitBehavior="true" PostBackUrl="search.aspx" CssClass="searchBtn" />
</div>
</li>
</ul>
<%
End If
%>
I think that the session will work just fine.
is there a way to navigate through gird found on this page by passing parameters in query string?
http://pubrec3.hillsclerk.com/oncore/search.aspx?bd=01/01/2008&ed=12/31/2008&bt=O&lb=1000000&ub=1000000000&d=5/6/2010&pt=-1&dt=D,%20MTG&st=consideration
Or any code suggestion?
All example could i need in C#.
I have a few ActionLinks that when rendered are getting a length key/value added that appears to indicate the number of characters of the controller name. How can this be removed?