|
thanx... for this beautiful answer...
i think you are right,i should use option 2, gridview paging ... though , it is not gonna be that easy. and yeah... can u please help me one more thing, i am confused regarding view state, somebody told me that view state is not created for each user, so if ur using sessions, u should not be using viewstate... i thought each session has separate viewstate...
thanx alot...
take care
haseeb
|
|
|
|
|
Hi, I have 3 .resx file, its using for language. For PrecompiledWeb;
I convert "Resource.en.resx" to "Resource.en.resources" using with ResGen.exe.
I convert "Resource.en.resources" to "App_GlobalResources.resources.dll" using with al.exe.
I do this operation for turkish and russian languages. So I have 3 App_GlobalResources.resources.dll for each language.
I paste this dll file in relevant directory. For example; ....\bin\en-US\
But I browse the web site it's not work. May be I merge this file using with aspnet_merge.exe and I get App_GlobalResources.dll but how I don't know.
How do solve my problem?
Not: I check "Allow this precompiled site to be updatable" when publish web site.
MY CODE USING ResGen.exe
------------------------
ResGen.exe en-EN/Resource.en.resx Resource.en.resources
ResGen.exe ru-RU/Resource.ru.resx Resource.ru.resources
ResGen.exe tr-TR/Resource.tr.resx Resource.tr.resources
MY CODE USING al.exe
--------------------
al.exe /nologo /t:lib /embed:Resource.en.resources /culture:en-US /out:en-EN/App_GlobalResources.resources.dll
al.exe /nologo /t:lib /embed:Resource.ru.resources /culture:ru-RU /out:ru-RU/App_GlobalResources.resources.dll
al.exe /nologo /t:lib /embed:Resource.tr.resources /culture:tr-TR /out:tr-TR/App_GlobalResources.resources.dll
Best Regards...
|
|
|
|
|
Hello, I searched and didn't find a good answer to these specific questions so I thought I'd post them here:
- What are some suggestions for the best ways people have used for site design for sites containing asp.net and c#?
- I'm getting more into asp.net using VS 2008 but have used Dreamweaver MX for over 5 years. I'd like to continue to use dreamweaver but also use VS for code development. Is that possible?
- Do most developers just stick with VS for full site design and deployment?
Thanks in advance for your responses and patience with my foolish newbie questions.
-----------
Jeff
|
|
|
|
|
I think each one have their own personal criteria ,
For me, if I have to develop something related with asp I will use only VS because it was specially created for that, I think DreamWeaver was made for design tasks and for static web pages.
Each tool has good function as well as weakness, all depends of your experience with each one.
My personal opinion.
|
|
|
|
|
In windows forms development, is it ever practical to use datasets over class objects to store data? What would you prefer and why?
Thanks
Tina
|
|
|
|
|
don't cross post, it is considered rude.
|
|
|
|
|
i have an asp.net application where i was trying to apply .net compression.
here is the code i used in global.asax
private void HttpCompress(HttpApplication app)<br />
{<br />
try<br />
{<br />
string accept = app.Request.Headers["Accept-Encoding"];<br />
if (accept != null && accept.Length > 0)<br />
{<br />
if (CompressScript(Request.ServerVariables["SCRIPT_NAME"]))<br />
{<br />
System.IO.Stream stream = app.Response.Filter;<br />
accept = accept.ToLower();<br />
if (accept.Contains("gzip"))<br />
{<br />
app.Response.Filter = new System.IO.Compression.GZipStream(stream, System.IO.Compression.CompressionMode.Compress);<br />
app.Response.AppendHeader("Content-Encoding", "gzip");<br />
}<br />
else if (accept.Contains("deflate"))<br />
{<br />
app.Response.Filter = new System.IO.Compression.DeflateStream(stream, System.IO.Compression.CompressionMode.Compress);<br />
app.Response.AppendHeader("Content-Encoding", "deflate");<br />
}<br />
}<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
}<br />
}<br />
<br />
private bool CompressScript(string scriptName)<br />
{<br />
if (scriptName.ToLower().Contains(".aspx")) return true;<br />
if (scriptName.ToLower().Contains(".axd")) return false;<br />
if (scriptName.ToLower().Contains(".js")) return true;<br />
return true;<br />
}<br />
<br />
protected void Application_BeginRequest(Object sender, EventArgs e)<br />
{<br />
HttpCompress((HttpApplication)sender);<br />
}<br />
i was testing the above implementation using the above code. I found that my .aspx requests were not gzipped. I checked using the tool Fiddler. it was showing normal 'HttpChunkedEncoding'. i don't know why it was not encoding even though i was wrapping the stream with Gzip Filter.
Strangely, with ajax requests, the gzip compression was working fine.
Can anybody please help me find the solution.
Thanks in advance
Tiju John
|
|
|
|
|
Hi,
I'm using .net 2008.i've a datagrid named 'dgUserNote'. I add edit,cancel,upadte and delete like this;
<asp:editcommandcolumn canceltext="Cancel" edittext="Edit" headertext="Edit" updatetext="Update" xmlns:asp="#unknown">
<asp:buttoncolumn commandname="Delete" headertext="Delete" text="Delete" xmlns:asp="#unknown">
and in coding part i written like;
void dgUserNote_EditCommand(object source, DataGridCommandEventArgs e)
{
dgUserNote.EditItemIndex = e.Item.ItemIndex;
}
but when i click edit first time it will not work; second time only it will work
likewise when i'm clicking cancel button first time it will not work,second time it is going to upadtecommand .
cancel i written like this;
void dgUserNote_CancelCommand(object source, DataGridCommandEventArgs e)
{
dgUserNote.EditItemIndex = -1;
}
and Update i written like this;
SqlCommand SqlCom;
try
{
if (ConGlobal.State == ConnectionState.Closed) ConGlobal.Open();
SqlCom = new SqlCommand("SpInsertUserNote", ConGlobal);
SqlCom.Parameters.Add("@IorU", SqlDbType.VarChar).SqlValue = "U";
SqlCom.Parameters.Add("@Title", SqlDbType.VarChar).SqlValue = e.Item.Cells[2].Text;
SqlCom.Parameters.Add("@Description", SqlDbType.VarChar).SqlValue = e.Item.Cells[3].Text;
SqlCom.Parameters.Add("@Date", SqlDbType.VarChar).SqlValue = e.Item.Cells[4].Text;
SqlCom.Parameters.Add("@UserName", SqlDbType.VarChar).SqlValue = mdlNewClass.gStrUserName;
SqlCom.CommandType = CommandType.StoredProcedure;
SqlCom.ExecuteNonQuery();
SqlCom = null;
Response.Write("Record Updated Successfully...");
BindData();
dgUserNote.EditItemIndex = -1;
}
pls help me in this issue
|
|
|
|
|
Maybe i'm missing something but my guess is you should rebind your DataGrid after the event fires.
Example with your Edit Handler
protected void dgUserNote_EditCommand(object source, DataGridCommandEventArgs e)
{
dgUserNote.EditItemIndex = e.Item.ItemIndex;
BindData();
}
If you Re-Bind your DataGrid after all your commands are issued it should work fine for you.
Best of luck,
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
Thanks for the solution. can u pls help me to find solution regarding with my Datagrid. I'm new to c#. in my coding i'm using control DataGrid named dgUserNote.
in its update command , i'm not getting the values in the cells
when i take e.Item.Cells[2].Text it shows like;
e.Item.Cells[2].Text=""
the code is as follows;
in designing part(asp) i add the Column as follows;
<columns> <asp:editcommandcolumn canceltext="Cancel" edittext="Edit" headertext="Edit" xmlns:asp="#unknown">
UpdateText="Update">
in coding (c#) i wrote like this;
void dgUserNote_UpdateCommand(object source, DataGridCommandEventArgs e)
{
SqlCommand SqlCom;
if (ConGlobal.State == ConnectionState.Closed) ConGlobal.Open();
SqlCom = new SqlCommand("SpInsertUserNote", ConGlobal);
SqlCom.Parameters.Add("@IorU", SqlDbType.VarChar).SqlValue = "U";
SqlCom.Parameters.Add("@Title", SqlDbType.VarChar).SqlValue = e.Item.Cells[2].Text;
SqlCom.Parameters.Add("@Description", SqlDbType.VarChar).SqlValue = e.Item.Cells[3].Text;
SqlCom.Parameters.Add("@Date", SqlDbType.VarChar).SqlValue = e.Item.Cells[4].Text;
SqlCom.Parameters.Add("@UserName", SqlDbType.VarChar).SqlValue = mdlNewClass.gStrUserName;
SqlCom.CommandType = CommandType.StoredProcedure;
SqlCom.ExecuteNonQuery();
SqlCom = null;
Response.Write("Record Updated Successfully...");
BindData();
dgUserNote.EditItemIndex = -1;
dgUserNote.DataBind();
}
pls help me to solve this problem
Thanks&Regards
Princy
|
|
|
|
|
On my Default.aspx page I have an iframe. The iframe has a button and does some calculation. But once the calculation is done I want to pass those values to a panel that is on my Default.aspx.
For instance
Default.aspx
------------------------------------
| |
| iframe |
| |-------------------------- |
| | Button | |
| | | |
| |-------------------------- |
| |
| Panel |
|___________________________________|
Is this even possible please help? Thanks
|
|
|
|
|
|
I am trying to create a server control library that includes an AJAX component from the AJAX toolkit. I have added the controls to the class and I am either
a) getting an exception thrown when I add the extender to the controls collection. This is the
Extender controls may not be registered after PreRender.
Error.
or b) not getting an exception but the control does not render to the page.
This is the code:
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
pExtender.Page = this.Page;
ScriptManager.GetCurrent(this.Page).RegisterExtenderControl<collapsiblepanelextender>(pExtender, pnContent);
EnsureChildControls();
}
protected override void RenderContents(HtmlTextWriter output)
{
try
{
//render panel to page
pExtender.Page = this.Page;
//set extender panel options
pExtender.ExpandedText = ExpandedTitle;
pExtender.CollapsedText = CollapsedTitle;
pExtender.ID = "cpe";
pExtender.TargetControlID = "pnContent";
pExtender.ExpandControlID = "pnTitle";
pExtender.CollapseControlID = "pnTitle";
pExtender.Collapsed = InitialCollapsedState;
pExtender.TextLabelID = "lblTitle";
pExtender.ImageControlID = "imgpanel";
pExtender.SuppressPostBack = false;
//set the id for the two content panels
pnContent.ID = "pnContent";
pnTitle.ID = "pnTitle";
//add the label panel to the control
pnTitle.Controls.Add(TheHeader);
//add the form to the panel
pnContent.Controls.Add(theForm);
//render title panel
//this.Controls.Add(pnTitle);
//render content panel
//this.Controls.Add(pnContent);
//pnSurroundingPanel.RenderControl(output);
this.Controls.Add(pExtender);
//pExtender.RenderControl(output);
//this.Controls.Add(pnSurroundingPanel);
//pnSurroundingPanel.RenderControl(output);
pnTitle.RenderControl(output);
pnContent.RenderControl(output);
}
catch (Exception ex)
{
DiagnosticMessage.reportError(ex);
}
}
If I comment out the line that is causing the exception, this.Controls.Add(pExtender); and replace it with pExtender.RenderControl(output); the exception is not shown but the page is blank and the control has not been rendered to the page.
Does anyone know how to get the ajax control to render properly to the page. I have seen several posts regarding this and have tried a few things but nothing has worked yet.
Any help is much appreciated as tis one has been driving me mental!
Notes:
TheHeader is a usercontrol for the header or closed state of the control and the TheForm is the usercontrol that is the content of the open panel.
Thanks
Simon
|
|
|
|
|
Hi
I quite new here and I have a question:
I have built page in VS2008 using c# & the following debug error:
CS1061: 'ASP.ds2_aspx' does not contain a definition for 'btnSubmit_Click' and no extension method 'btnSubmit_Click' accepting a first argument of type 'ASP.ds2_aspx' could be found (are you missing a using directive or an assembly reference?)
Line 50: <tr>
Line 51: <td class="main" style="width: 135px"> </td>
Line 52: <td class="main" style="width: 278px"><input type="Submit" id="btnSubmit" OnServerClick="btnSubmit_Click" value="Send" runat="server" onclick="return btnSubmit_onclick()" /></td>
Line 53: </tr>
Line 54: </table>
and I would appreciate any suggestions
|
|
|
|
|
Your code behind class is missing the btnSubmit_click method you defined in OnServerClick.
Add a method to your cs file:
public void btnSubmit_Click(object sender, EventArgs e) {
...
}
|
|
|
|
|
And it would probably be a good idea to use an ASP button rather than an HTML button.
|
|
|
|
|
In my C:/WIDOWS/TEMP folder on my web server, the list of temporary files are too much. Can it affact the overall performance of my web server.
I delete it manually every morning when I start the server .
What Should I do?
Ashish Jha
Software Engineer
|
|
|
|
|
You should probably try to find out what is creating the temp files.
|
|
|
|
|
I created a scheduled task that runs on Saturdays that cleans up various folders on my server. These files are created as part of some report generation and web application logs.
I would also recommend that after cleaning up these files, you may also consider defragmenting the drive. Creating and deleting files can have a negative impact on server performance due to the fragmentation that is created on the drive.
|
|
|
|
|
Hi,
If I close the browser window, session_end doesn't get fired.
I want to do some updations in database when the user tries to close the window wiithout cliking on 'Logout' button provided.
Any solution for this problem?
|
|
|
|
|
If you close the browser, the session end will automatically called when it reached to the time out.
if you want to explicitly doing something on browser close, just detect the browser close during using javascript and open some small popup which will clear the database data from server side code then close the popup also.
if you find the code project asp.net forum you will find lots of similar question and answer.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Thank u. Can u give some links to refer for the solution?
|
|
|
|
|
Its not good to get client events by using the javascript.
Another way is to write the code in the Session_End event similar event is there (I forgot )
there you can have you logic what you want to do whenever user session has been end.
One question
1. Do you need to do update the DB no sooner user closed the window ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Sandeep Akhare wrote: Its not good to get client events by using the javascript.
Then how will you trap the browser close event ?
if you want to detect browser close you have to use javascript.
Sandeep Akhare wrote: Another way is to write the code in the Session_End event similar event is there (I forgot D'Oh! )
there you can have you logic what you want to do whenever user session has been end.
if you use Session.Abandon(), it will directly moved to Session_End() event in your Global.asax file, and inside that methods you can write your logic that what ever you want to implement.
Sandeep Akhare wrote: One question
1. Do you need to do update the DB no sooner user closed the window ?
As per my understanding, he is storing some user information while user log into the system. and he is removing those in the log off. But, the problem happens when user close the browser. If user close the browser, Session_end() will only call when its time out.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Abhijit Jana wrote: As per my understanding, he is storing some user information while user log into the system. and he is removing those in the log off. But, the problem happens when user close the browser. If user close the browser, Session_end() will only call when its time out.
That should fine and this make sure that every time Session_End gets called
1. Please tell me what happens when system crashed or browser crashed for a perticular user...
2. depending on the client browser is not idle way as there can be many scenario there javascript may get failed.
that's why i asked him is it necessary to update the DB no sonner user closed the browser?
I think log information he can update when session_end gets called?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|