|
I want an editable Dropdown for the asp.net application. This ASP.net 2.0.
Please can anybody provide the code?
|
|
|
|
|
|
|
I have a background image and I want a part of it to be transparent (instead of white). Is that any way to do it?
|
|
|
|
|
Use photoshop to do that.
|
|
|
|
|
Create Watermark image using some tool, then set it as Table background !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I m developing a online exam portal . I have used a javascript for timer. when time finishes it should fire a button_submit.
but when user hits a refresh button time is starting from first.
Is there any way to copy timeAlloted value when page is unloaded . or to use any session variable to store the value before unload and retrive after reloading the page.
** i have used question paper in iframe and timer display in parent page. when time finishes it should fire a submit_click which is hidden in question page(inside iframe).
|
|
|
|
|
Be aware that whatever you do, unless you store the time you started on the server, the user will be able to cheat it. And if you store it on the server, you can use that on postback to refresh the time remaining.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
After logging out of my web application I do not want the user to be able to get back into it simply by clicking the browser Back button.
After doing some reading I don't think javascript will allow you to clear browser cache. Do I have to prevent all my asp pages from being cached? On commercial sites it seems that caching is on because the Back button does work. However, after logging out and hitting the Back button an expired page is displayed. How do they do this?
|
|
|
|
|
|
Place this on every page for which you want the back shouldnt be enabled :
function disableBack(){window.history.forward();}
disableBack();
window.onload=disableBack;
window.onpageshow=function(evt){if(evt.persisted)disableBack();}
window.onunload=function(){void(0);}
This is tested on MSIE, FireFox, Safari and Opera.
|
|
|
|
|
Does this mean when you have a logout feature you cannot use the browser cache?
|
|
|
|
|
Hi,
I am using ultrawebgrid in my pages. I am specifying the EditorControl by setting EditorControlID in the InitializeLayout event of the grid. This works fine if I don't have paging or if I am not rebinding the grid. When I enable the paging, the EditorControl works fine in the first page. But when we move to the next page, the EditorControl get's lost. The same is the case when I rebind the grid (as I did in paging). I am giving you the sample code below. Can anyone please help me in resolving this?
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitializePage();
}
}
private void InitializePage()
{
PopulateReportingPeriodTasksGrid();
Infragistics.WebUI.UltraWebGrid.UltraWebGrid comboGrid = (Infragistics.WebUI.UltraWebGrid.UltraWebGrid)StatusCombo.Controls[0];
comboGrid.DisplayLayout.AllowAddNewDefault = Infragistics.WebUI.UltraWebGrid.AllowAddNew.Yes;
comboGrid.DisplayLayout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes;
}
private void PopulateReportingPeriodTasksGrid()
{
DataSet ds = new DataSet();
ds.Clear();
ds = DataService.ListReportingPeriodTask(UserIdentity, (int)TaskStatus.Status.Open);
if (ds != null)
{
ReportingPeriodTasksGrid.DataSource = ds.Tables[0].DefaultView;
ReportingPeriodTasksGrid.DataBind();
}
}
protected void ReportingPeriodTasksGrid_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
e.Layout.Bands[0].Columns.FromKey("TaskStatus").Header.Caption = "Status";
e.Layout.Bands[0].Columns.FromKey("TaskStatus").Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom;
e.Layout.Bands[0].Columns.FromKey("TaskStatus").EditorControlID = "StatusCombo";
e.Layout.Bands[0].Columns.FromKey("TaskStatus").AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes;
e.Layout.Pager.AllowPaging = true;
e.Layout.Pager.PageSize = 25;
}
protected void ReportingPeriodTasksGrid_PageIndexChanged(object sender, Infragistics.WebUI.UltraWebGrid.PageEventArgs e)
{
this.ReportingPeriodTasksGrid.DisplayLayout.Pager.CurrentPageIndex = e.NewPageIndex;
PopulateReportingPeriodTasksGrid();
}
This is one scenario as I explained above...in case page index changed, I am calling the PopulateReportingPeriodTasksGrid() function again and that's when the EditorControl stops working. I've another page, where I am not using "paging", but doing the same as I am doing in the PopulateReportingPeriodTasksGrid procedure. Even in that case, the EditorControl will not work.
Thanks,
Kala
|
|
|
|
|
I think it is better to write this in Infragistics Forum as you will get more people regarding this.
I think the problem is because of not handling the Viewstate of the control properly. check yourself if you are missing something.
You may try removing the line :
PopulateReportingPeriodTasksGrid();
from ReportingPeriodTasksGrid_PageIndexChanged to see what happens then.
|
|
|
|
|
Hi Abhishek,
ThanQ!
I've posted in Infragistics forums also. I am trying to see if someone here faced this kind of problem. We need to bind the grid in PageIndexChanged event. Otherwise, paging won't work.
-Kala
|
|
|
|
|
Have you check removing the line which repopulates the data again.
Also try to do another this
In page_Load write
if (!IsPostBack)
{
InitializePage();
}
PopulateReportingPeriodTasksGrid();
}
and
protected void ReportingPeriodTasksGrid_PageIndexChanged(object sender, Infragistics.WebUI.UltraWebGrid.PageEventArgs e)
{
this.ReportingPeriodTasksGrid.DisplayLayout.Pager.CurrentPageIndex = e.NewPageIndex;
}
I think this might be the problem, you are setting the CurrentPageIndex before the data being bound to the control. I am curious if this is the problem with you??
|
|
|
|
|
This change didn't fix it. I see that there is a javascript error though - "'null' is null or not an object".
As said in my initial post, it's not just with paging, whenever I had to rebind the grid, this problem occurs. Looks like the fact that there is an Editor Control is getting lost ( due to viewstate issue or some other problem). I am still trying to debug the same!
Thanks,
Kala
|
|
|
|
|
Anyone? Any thoughts?
In fact, it looks like it's happening on Postback. Am I missing something in restoring the state or something like that? Can you please test the same in a sample application? I tried setting the postback properties to true for the grid but it didn't work!
Thanks,
Kala
|
|
|
|
|
Hi All,
I am trying to create Enum Dynamically.
When I try to Save dll It gives me error - "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" I am also writing code snippet :-
AppDomain currentDomain = AppDomain.CurrentDomain;
AssemblyName aName = new AssemblyName("TempAssembly");
AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(aName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int));
eb.DefineLiteral("Low", 0);
eb.DefineLiteral("High", 1);
Type finished = eb.CreateType();
ab.Save(aName.Name + ".dll");
I got error at last line. I am working on Vista Premium.
I gave permissions to Network Service User but still not solved.
Please help me.
your help is appreciated.
Regards,
Sdhimann
|
|
|
|
|
I am not getting the point of creating a dynamic enum in ASP.NET.
AFAIK, ab.Save() will save the files to AppDomain.CurrentDomain.BaseDirectory . What value are you getting in AppDomain.CurrentDomain.BaseDirectory ? If the path you get is outside the website area, ASP.NET can't write to there.
|
|
|
|
|
Navaneeth,
I have already answered him last night about the problem. I dont know why he is putting the same question again and again in the forum rather than replying the last replies.
|
|
|
|
|
Hi Navaneeth
I want to use Enum in Web parts to show DropDown.
Web parts use only Enum to bind Dropdown.
is there ant other way to solve this problem ?
thanks
|
|
|
|
|
$unil Dhiman wrote: is there ant other way to solve this problem ?
May be. But you haven't answered to my questions which I asked on my last post.
|
|
|
|
|
Hi Navaneeth
Sorry !!!
I got busy in an urgent task at that time.
|
|
|
|
|
If this code is all you are trying to do, then you are wasting your time. Just create the Enum class for you enumerator.
On the other hand if this is a test for more complex process you should discuss this instead. For example, building enumerators from the database is a matter of Googling Emitting Enumerators using T4 . Then learn how to use T4 to dynamically build your classes inline with your code.
|
|
|
|