|
I have done expand/collapse for each individual panel..But if I add one more panel and click of this I want the rest of the panels to expand/collapse..
Can you provide the code for this.......!
|
|
|
|
|
hi
i need a scenario where i need to show all methods in a list view and a the point of executing the program i need to show that in listview that method is executing with some tick mark after completion. considering method taking some time .
thanks in adv..
|
|
|
|
|
|
I have an aspx page and and I utilize a static web method defined in the codebhenind of the page. I need a way to access controls on the page to do some databinding from this static method, but when I try to access the control I get the following error:
Error 1 An object reference is required for the non-static field, method, or property 'AccessRequestForm.AssignRole.UpdateRoleGrid
How do I access an instance of the page I am on from a static method? The codebehind I am using is included below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Xml;
using System.Xml.XPath;
using AccessRequestForm.UtilityServices;
using AccessRequestForm.BusinessServices;
using AccessRequestForm.Models;
using AjaxControlToolkit;
namespace AccessRequestForm
{
public partial class AssignRole : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
IQueryable<MasterRole> roleList = Role.SelectAll(Convert.ToInt32(strBUSelected));
lstRoles.Items.Clear();
foreach (MasterRole role in roleList)
{
ListItem li = new ListItem(role.role_business_desc.ToString(), role.role_id.ToString());
lstRoles.Items.Add(li);
}
UpdateRoleGrid(roleList);
}
}
public void UpdateRoleGrid(IQueryable<MasterRole> roleList)
{
grdRoles.DataSource = roleList;
grdRoles.DataBind();
}
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count, string contextKey)
{
IQueryable<MasterRole> roleList = Role.SelectStartPattern(Convert.ToInt32(contextKey), prefixText);
List<string> items = new List<string>(count);
int i = 0;
foreach (MasterRole role in roleList)
{
if (i++ < count)
{
string strName = role.role_business_desc.ToString();
items.Add(strName);
}
}
UpdateRoleGrid(roleList);
return items.ToArray();
}
}
}
|
|
|
|
|
If you understand the ASP.NET lifecycle you will understand why it is not possible to do this. You are calling the GetCompletionList method out of band, meaning that the request is not being processed by the ASP.NET engine hence the controls are not being created and thus not available for access. Typically this type of action is handled with client side JavaScript, or perhaps an AJAX UpdatePanel would be more useful for you.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I want to implement a solution (like AJAX AutoCompleteExtender) where the information entered in a text box filters the rows displayed in a GridView. So as the user types in letters in the textbox, it will trigger the OnKeyPress event on the client side, pass the letters entered to a WebMethod on the server side, and get the results back in a callback routine on the client side. The problem is now that I have the data on the client side, how do I refresh the contents of the GridView with it?
Is there a better way to approach this? I thought of UpdatePanel but I need to capture the OnKeyPress on the client side because the textBox does not trigger KeyPress events on the server side.
Thanks.
Adam
|
|
|
|
|
|
|
I'm currently developing a compositecontrol, there was something I didn't understand, so I decided to create a little control to reproduce the problem to find out why this problem occurs. When running the following code I get the error above.
<ParseChildren(False, Nothing), PersistChildren(True)> _
Public Class CompositeTest
Inherits CompositeControl
Dim pnl As Panel
Dim txt As TextBox
Dim dde As AjaxControlToolkit.DropDownExtender
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
MyBase.OnInit(e)
pnl = New Panel
txt = New TextBox
dde = New AjaxControlToolkit.DropDownExtender
End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
pnl.ID = "pnl"
txt.ID = "txt"
dde.ID = "dde"
dde.TargetControlID = "txt"
pnl.Controls.Add(txt)
pnl.Controls.Add(dde)
Controls.Add(pnl)
'MyBase.Render(writer)
End Sub
End Class
The question is why does this happen? And where in a control's lifecycle will a (extender-) control be registered?
|
|
|
|
|
let's have a look to my little dummy control again
on this way it works, but is it the right way to work with a composite control?
<ParseChildren(False, Nothing), PersistChildren(True)> _
Public Class CompositeTest
Inherits CompositeControl
Dim pnl As Panel
Dim txt As TextBox
Dim dde As AjaxControlToolkit.DropDownExtender
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
pnl = New Panel
txt = New TextBox
dde = New AjaxControlToolkit.DropDownExtender
pnl.ID = "pnl"
txt.ID = "txt"
dde.ID = "dde"
dde.TargetControlID = "txt"
pnl.Controls.Add(txt)
pnl.Controls.Add(dde)
Controls.Add(pnl)
MyBase.OnInit(e)
End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
pnl.RenderControl(writer)
End Sub
End Class
|
|
|
|
|
hy,
I have a gridview in which i have a list of files.i want a code which should help me to print the entire file without opening it.the file would get printed by the default printer that had been set.the file may can be of ay format like pdf or txt etc.
Thnks & Ragards ,
Raghvendra Panda
|
|
|
|
|
Can't be done. There is no way to create a piece of software that can handle any and all file formats and correctly send them to a printer.
I am also glad it can't be done. No web page should be able to take over my hardware. I can just imagine some shady ink cartridge company with a banner for ink refills printing several pages of 8x10 black squares and their ad says "Are you low on ink? Maybe you should check again."
|
|
|
|
|
Below may help you
<button onclick="printPage()">print</button>
<div id="printerDiv" style="display:none"></div>
<script>
function printPage()
{
var div = document.getElementById("printerDiv");
div.innerHTML = '<iframe src="mypage.aspx" onload="this.contentWindow.print();"></iframe>';
}
</script>
For more help : pranayamr.blogspot.com
|
|
|
|
|
hy...thnks for the code..itz working fine...but i want to set default printer settings so that the print dialog doesnt come out..
can u please tell me how i can do that...
|
|
|
|
|
Dear friends,
I am trying to upload one excel file to sqlserver database by using fileupload control. I am initially uploading the file and saving in a temporary folder and from this temporary folder I am copying the data to SqlServer Table. After copying the data, I want to delete the file in Temporary Folder. I wrote File.Delete(filename) code, but it is throwing following exception
[System.IO.IOException] = {"The process cannot access the file 'E:\\SourceSafe\\ESSP\\Finance\\FinancePL\\uploadedfiles\\samplePS.xls' because it is being used by another process."}
It is not allowing to delete the file. Please, can anyone help me in this. It's very urgent. Please....
Thanks,
Dileep.
|
|
|
|
|
You have to release resources used during the first phase of your code, which is saving file into physical space/directory. For example:
fileObjectUsed.dispose();
OR
FileUpload1.dispose();
I would recommend you not to store file into your web server location as this will add extra overhead of saving and deleting files and of-course security problem. You can directly store it(file) into database by converting it to bytes. Check out the link Storing Binary Data to Database using ASP.NET 2.0[^]
Observe the code lines...
Dim imageBytes(fileUpload1.PostedFile.InputStream.Length) As Byte
fileUpload1.PostedFile.InputStream.Read(imageBytes, 0, imageBytes.Length)
puranonnet@hotmail.com
BCS Technology
|
|
|
|
|
Lots of information missing though. The moment you uploaded it to temp folder, how do you upload it to database? Is the upload to DB process simultaneously going on? Immediately or afterwards? Is that process of uploading to DB is in progress when you try to delete it?
Looks like the temporary folder is a Sourcesafe folder. Those are write protected.
Lastly, you should directly upload it to DB instead of inserting an extra step in between and having a performance hit!
|
|
|
|
|
i m using UrlRewritingNet and url rewriting is working fine but i m facing a serious issue. i have just one page in the site. and lots of updatepanel are used in the sites. i have use the rules as u define in ur article.
<urlrewritingnet
rewriteOnlyVirtualUrls="true"
contextItemsPrefix="QueryString"
defaultPage = "default.aspx"
defaultProvider="RegEx" xmlns="http://www.urlrewriting.net/schemas/config/2006/07" >
<rewrites>
<add name="Detail"
virtualUrl="^~/detail/(.*).aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/detail.aspx?s=$1"
redirect="none"
ignoreCase="true"
/>
</rewrites>
</urlrewritingnet>
i have check when the paging is clicked the response is sent to the server but the pagebutton click event is not fireing.
and as a result i get this error.
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html P'.
i hope u will have solve this problem.
i think its .axd problem please sugest a solution.
amirzada
|
|
|
|
|
It looks like you want to ask this question to an author related to his/her article.
I would suggest you to please use the forum present at the end of the article in order to reach author and get quick response. Rarely you will find authors reading this forum.
Please post the same at the article's message forum.
|
|
|
|
|
hi,
i am having a page with gridview and i want to open the page in master page...so to do this i removed the runat server attribute from the page and on the link button of the master page i referred the page with gridview ...but showed me an error " form with gridview must have runat=server attribute". when i put this attribute...and try to open in master page, the page with gridview loads leaving the masterpage....i figured out that when my masterpage form and gridview page form tag both have runat= server attribute then the gridview page will be loaded leaving the masterpage.
Afiz Momin
|
|
|
|
|
please, tell me if u need a code .
|
|
|
|
|
What is this? Why are you posting to your question. In case you want to add anything to whatever you have asked, you can always go and edit it!
|
|
|
|
|
Ok! Here are few things you need to read on first...
1. What does runat=server means. So, basically, what will happen if you remove it or add it to the control.
2. Can a page that has a Master page have multiple form tags that has 'runat=server ' in it? How many form tags with runat=server is allowed?
|
|
|
|
|
runat=server attribute indicates that the element should be treated as a server control And page can have one or more forms in page.
How many form tags with runat=server is allowed? --> this thing i dont know.
but form requires a runat attributes when using GridView
Plz give briefing on this and solution to the problem..
thank u..
|
|
|
|
|