|
Hello every one,
I am new comer in software field.I am developing a website,
I don't have an idea about creating role and all these things.
Then tell me about
1.how to create a role.
2.How to asign them access right.
3.Should i manage them in database or any other place.
Fianlly give basic idea about Admin module.
|
|
|
|
|
|
Hi all,
I am trying to bind a datatable to a Gridview,
In each row i add a usercontrol, The table has 8 rows,
The problem is when i call the GridView.Databind() method,
and extra row is added to the gridview i.e. the gridview displays 9 rows on the page.
What could be the cause of this?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
AB7771 wrote: In each row i add a usercontrol,
To where you are adding this? To a new column?
Hard to give suggestions without seeing the code.
|
|
|
|
|
I am binding a dataset to a Gridview.
Gridview1.DataSource = dtTable;
GridView1.DataBind();
And in the GridView1_RowCreated() method
I add the usercontrol for each row.
TableCell cell = new TableCell();
e.row.cells[0].Add(LoadControl("~/Usercontrol1.ascx"));
Hope that clears it.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
I have a checkbox in my form. When the checkbox is checked , i want to fire a javascript which makes some controls as visible or not visible. I have writtent the code,but the javascript is not firing. Can anybody please help me on that? Am I doing something wrong here?
Following is my code:
<script type="text/javascript">
function SetCopyPermissionsControlState(panelControlId, checkBox) {
alert("hai");
var enabled = checkBox.checked;
var panelControl = document.getElementById(panelControl);
if (panelControl)
{
if (enabled)
{
panelControl.style.display = 'block';
}
else
{
panelControl.style.display = 'none';
}
}
<tr><td class="labeltext"><asp:CheckBox ID="chkCopyPermissions" runat="server" Text = "CopyPermissions;"
OnClick="SetCopyPermissionsControlState(CopyPermissionsPanel,this)" /></td>
<td><asp:Label ID="lblCopyPermissionMessage" runat="server" ></asp:Label></td>
</tr>
<tr>
<asp:Panel ID = "CopyPermissionsPanel" runat = "server" Visible="false">
<td class="labeltext"><asp:Label ID = "lblCopyPermissions" runat = "server" Text = "Existing UserName" ></asp:Label></td>
<td><asp:TextBox id = "ExistingLoginTextBox" runat="server" TextMode="SingleLine" MaxLength="50"></asp:TextBox>
<asp:Button ID = "CopyPermissionsButton" runat="server" Text="Copy" OnClick="CopyPermissionsButton_Click" />
</td>
</asp:Panel>
</tr>
Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
var panelControl = document.getElementById(panelControl);
Please pass the actual proper id to the method. I guess it should be panelControlId
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
meeram395 wrote: var panelControl = document.getElementById(panelControl);
Shouldn't this be var panelControl = document.getElementById(panelControlId); ?
meeram395 wrote: OnClick="SetCopyPermissionsControlState(CopyPermissionsPanel,this)"
Don't you need a single quote (')? OnClick="SetCopyPermissionsControlState('CopyPermissionsPanel',this)
When you are using server control id in JS, best practice is to use ClientId . Your code will break if you plan to make the panel as a child of some other container control because ASP.NET will change the name when it render the control.
|
|
|
|
|
ok. thanks. now the javascript is firing. but the panelcontrolid is firing. I opened View-->Source, but couldn't find the control asp panel. what could be the issue? Any guess?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: but the panelcontrolid is firing.
What do you mean?
meeram395 wrote: I opened View-->Source, but couldn't find the control asp panel. what could be the issue?
Browsers only understand HTML. ASP.NET will convert ASP:Panel to HTML DIV (not sure) when it is rendering the page. So you don't see ASP:Panel in the view source.
|
|
|
|
|
I have removed the panel control and I put an id to row.Now it is working fine. Following is the codew:
<tr><td class="labeltext"><asp:CheckBox ID="chkCopyPermissions" runat="server" Text = "CopyPermissions"
OnClick="SetCopyPermissionsControlState('CopyPermissionsRow',this)" /></td>
<td><asp:Label ID="lblCopyPermissionMessage" runat="server" ></asp:Label></td>
</tr>
<tr id="CopyPermissionsRow" visible="false">
<td class="labeltext">
<asp:Label ID = "lblCopyPermissions" runat = "server" Text = "Existing UserName" ></asp:Label>
</td>
<td>
<asp:TextBox id = "ExistingLoginTextBox" runat="server" TextMode="SingleLine" MaxLength="50"></asp:TextBox>
<asp:Button ID = "CopyPermissionsButton" runat="server" Text="Copy" OnClick="CopyPermissionsButton_Click" />
</td>
</tr>
Because of the above change, the javascript function , SetCopyPermissionsControlState, is firing now. But the issue is, I made it visible=false when the page loads which is not happening. The page loads by displaying the controls. However, when I check the checkboxes, it is changing accordingly. Any idea why it is not happening for the first time?
I don't want postback, because there is a password textbox in the form which erases the value on postback.
Following is my javascript function:
function SetCopyPermissionsControlState(rowControlId, checkBox) {
var enabled = checkBox.checked;
alert("enabled" + enabled);
var rowControl = document.getElementById(rowControlId);
alert("panelControl" + rowControl);
if (rowControl)
{
if (enabled)
{
rowControl.style.display = '';
}
else
{
rowControl.style.display = 'none';
}
}
}
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
try to make auto post back property = true;
|
|
|
|
|
I don't want autopostback property to true, since there is a password textbox in the page which is losing value on postback. so everytime there is a postback, the user has to retype which is quite cumbersome.
Is there any other way?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
In the HTML I have -
<%#ShowProjectUrl(Eval("website_url").ToString())%>
In the code behind I have -
protected string ShowProjectUrl(string projectUrl)
{
if (projectUrl != String.Empty)
return "<br />Project URL - <a href='" + projectUrl + "' target='_blank'>" + projectUrl + "</a><br /><br />";
else
return String.Empty;
}
The website is stored in the DB as www.XXX.com and passes to the function OK.
But when I click on the hyperlink at run time it navigates to -
http://localhost/www.XXX.com
If anyone know hoe to get rid of the localhost, it would be most appreciated.
Thanks.
|
|
|
|
|
u should plus http://www.xxx.com
going like dis
return "<br />Project URL - <a href='http://" + projectUrl + "' target='_blank'>" + projectUrl + "</a><br /><br />";
|
|
|
|
|
Thank you very much, that has worked!
|
|
|
|
|
hihi welcome.. n gud luck =D
|
|
|
|
|
hi all
Im using Ajax timer for web site asynchronously loads some details, so when i click one of that item sometimes it display this error,im not using any Resonse.Write().
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 PUB'.
Pls help me solve this , this is bit urgent
Thanks
|
|
|
|
|
Can you show the server side code?
|
|
|
|
|
anyone know how to use this file?
i already create 1 resx file in my webcontrol project.. then i put javascript in this res.
then i want to register js file into my page using dis..
Me.Page.ClientScript.RegisterClientScriptResource(GetType(ScriptsManager), "MyControl.prototype.js")
MyControl = my namespace
prototype.js = my js file
ScriptsManager = my Public Class
but output say :
<script src="/ReMS_V2/WebResource.axd?d=loL1DUSbq11mfdlYGrmMGW-hYUrL63jxbEa6WSRmzFC2sNXk2_iY9ZAY8UffrfgR0&t=633828149324159480" type="text/javascript"></script>
n still error coz file note found..
i'm using asp.net vb language..
anyone can help me? plz...
modified on Friday, July 10, 2009 2:46 AM
|
|
|
|
|
syaiful_86 wrote: i already create 1 resx file in my webcontrol project.. then i put javascript in this res.
Not sure resx files can be used to put JS. They are mostly used to create localizable applications. Here[^] is a quick start article.
Are you trying to embed JS with your web control? If yes, read this[^] article. I have explained the tricks to embed JS in that article.
|
|
|
|
|
|
syaiful_86 wrote: "System.Web.UI.WebControls.headerbg.gif" = must be declare 1st like this
[assembly: System.Web.UI.WebResource ("System.Web.UI.WebControls.headerbg.gif",
"text/js", PerformSubstitution = true)] or not?
That code shows embedding the image into the assembly. I'd suggest to download the code provided with that article. Try to create a simple control by referring that code. If everything is OK, move that to your main project.
Read MSDN documentation about the methods used. It will help you to get started.
|
|
|
|
|
Hi.. thanks.. but still cannot..
maybe i dun understand
can u help me xplain this
Me.Page.ClientScript.RegisterClientScriptResource(Me.GetType, "MyControl.Resources.Myjs.js")
Me.GetType
-what type we should put in? class type? control type?
"MyControl.Resources.Myjs.js"
-MyControl mean assembly name? name space?
-Resources how we get dis?
-Myjs.jswe should put file name izit?
|
|
|
|
|
syaiful_86 wrote: -what type we should put in? class type? control type?
It can be any type. Me.GetType should do.
syaiful_86 wrote: "MyControl.Resources.Myjs.js"
-MyControl mean assembly name? name space?
You need fully qualified path which starts from the namespace name.
syaiful_86 wrote: -Myjs.jswe should put file name izit?
Yes. You need your file name here. MSDN[^] has an example which will get you started.
|
|
|
|