|
cool... what did you do?
|
|
|
|
|
//Getting the UnitId
public string GetUnitId(string UserId)
{
string sqlstatement;
try
{
sqlstatement = "SELECT UnitId FROM department_Members WHERE UserId='"+UserId+"'";
return dbtObj.GetColumnValue(sqlstatement, "UnitId").ToString();
}
finally
{
}
}
//Checking The Unitid
protected void BindRblDftUnit()
{
MembershipUser MU;
string UserId;
MU = Membership.GetUser();
UserId = MU.ProviderUserKey.ToString();
string dUnitId = asObj.GetUnitId(UserId);
string dRoleId = asObj.GetRoleId(UserId);
if (dUnitId != null && dRoleId != null)
{
RblDefaultUnit.Items.Add(new ListItem("Sreejith", "Sreejith"));
RblDefaultUnit.Items.Add(new ListItem("Alex", "Alex"));
}
}
Yesterday i post this query.First of all sorry to post it agin.
The above code is to get the unit id checking with the userid.That means if the user login had the particular unitid.I want to chk that.If the use had login had no unit id thn an exception in sql is displayed.The exception is object reference is not set.How i overcome it..Laos i attach the checking functinality itself with this mail.Please help me to overcome the pbm....Thanks
|
|
|
|
|
change your logic, if your GetUnitId method doesn't have any record then it should send something which shows that it return null.
Push your brain and it will work out for you
|
|
|
|
|
Hi
I am trying to create a page that when I access it using the Internet Explorer, the page will not load, and in the Internet Explorer's status bar, the status will be "Loading".
(I need it to create tests for my systems)
I tried to add Thread.Sleep(1000000) on Load_Page event, but then the IE froze and the status was "Connected"
I also tried to add the frame tag. and in it i called another page, but for some reason it didn't get stack at all.
Can anyone help me?
thank you in advanced,
Daniel
ASP page that stacks on status loading
|
|
|
|
|
Am trying to access a file from remote machine(IIS)
Response.Redirect(~/SalarySheets/" + OffID + ".xls"; ) will work only when the SalarySheets also are locally present on a folder in my app.
But what I have to do is to pick the xls from remote IIS.
I should be able to access file from remote path
@"\\prod-sal\Salary\SO-WEBDIST-XLS\" + OffID + ".xls";
I cant use Response.Redirect(@"\\prod-sal\Salary\SO-WEBDIST-XLS\" + OffID + ".xls")
Can you suggest something else please?
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
Tried Page.ResolveUrl but the remote machine has a user id and pwd.
I should supply credentials on my .net page and fetch the ms excel data.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
i have to show a message when the entered value is not having length greter than 6.for that i am writing following javascript.
I call this javascript on onblur of text,but i cant get focous back to desired textbox.
it goes to another control.I am using server control.
Javascript Function
-------------------------
function lengthCheck(obj)
{
if(obj.value.length<6){
alert("wrong name");
obj.value="";
obj.focus();
}
}
-------------------------
here i use it
<asp:textbox id="TextBox1" runat="server" onblur="return lengthCheck(TextBox1);"></asp:textbox>
can one help to me,so that i will fix my problem.
thanking U
|
|
|
|
|
The following CodeProject[^] article has the information you require.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I am using server control.
also it not woking on any other browser other windows internet explorer
|
|
|
|
|
Hi,
I am using MultiView / View controls which change by MenuItem clicks. Each view has a GridView on it with Edit and Insert features.
The problem is: 1) when the edit button is clicked, the GridView disappears and you need to click on the MenuItem again to see it (it happens evrytime you click edit, update, cancel or insert buttons on the GridView)
2) When you click a MenuItem, the page is posted back and displays from the top again, but I want it to stay at the height where it left so that the users dont have to scroll down again to see the GridView. I can probably use javascript, but I was wondering if there is any asp .net way to fix it?
All ideas are welcome.
Thanx for your help.
Ekjon
|
|
|
|
|
hi guys i am new to asp.net, i have created a class on a webform and want to use the class on another webform, can someone please tell me how to accomplish this? i am using vs2005 with c# thanks
|
|
|
|
|
Why don't you create the separated class? you can use this class in both web forms.
|
|
|
|
|
If I understand you correctly, doing the following should solve your problem.
Right click on your solution, and hover over Add ASP.NET folder. The submenu will expand, and choose App_Code.
If you place your class file in that folder that is created, all of your webforms should be able to use it.
HTH
|
|
|
|
|
thanks guys, solved it by doing this:
Right click on your solution, and hover over Add ASP.NET folder. The submenu will expand, and choose App_Code.
If you place your class file in that folder that is created, all of your webforms should be able to use it.
|
|
|
|
|
Hi,
This is from Chandrakanth.
Now I am working on asp.net 2.0
My Problem is i have one Page called "Search".In that search page i have Text Box called "txtUserName".
And i entered some letter in that Textbox.
Based on that letter list of records are displaying with Radio Buttons in gridview.
And i want to select only one record from the gridview by selecting RadioButton.
at present i can able to select multiple records by clicking radio buttons.
i do want to select only one record, Then Rest of the radio buttons record should be unselect in gridview.
Can any one help me for this.
Thnaks in advance
here i am giveing Gridview code also
<table id="tblEmpDtls" cellspacing="2" cellpadding="2" width="100%" border="1" runat="server">
<tr>
<td class="TableHead" colspan="2"> Employee Details</td>
</tr>
<tr>
<td class="TableRow" colspan="4">
<asp:GridView ID="gdvUserSearch" runat="server" AllowPaging="True" AllowSorting="True" PageIndex="15" AutoGenerateColumns="False" Width="100%" Height="77px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:RadioButton ID="rdSelect" runat="server" Text="Select" GroupName="rdBox" OnCheckedChanged="rbdefault_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="User Id" DataField="UserId" />
<asp:BoundField HeaderText="User Name" DataField="UserName" />
<asp:BoundField HeaderText="Email Id" DataField="Email" />
<asp:BoundField HeaderText="Mobile No" DataField="Mobile_No" />
</Columns>
</asp:GridView>
</td>
</tr>
</table>
Thanks and Regards
Chandrakanth
Chandrakanth
|
|
|
|
|
|
HTML view
=========
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>]]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function SetUniqueRadioButton(nameregex, current)
{
re = new RegExp(nameregex);
for(i = 0; i < document.forms[0].elements.length; i++)
{
elm = document.forms[0].elements[i]
if (elm.type == 'radio')
{
if (re.test(elm.name))
{
elm.checked = false;
}
}
}
current.checked = true;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" datakeynames="CustomerID" datasourceid="SqlDataSource1" onrowcreated="GridView1_RowCreated">
<columns>
<asp:boundfield datafield="CustomerID" headertext="CustomerID" insertvisible="False">
ReadOnly="True" SortExpression="CustomerID" />
<asp:boundfield datafield="CustomerName" headertext="CustomerName" sortexpression="CustomerName" />
<asp:templatefield headertext="ABC">
<itemtemplate>
<asp:radiobutton id="RadioButton1" runat="server" groupname="rbBox" />
</itemtemplate>
</asp:templatefield>
</asp:boundfield></columns>
</asp:gridview>
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:EmployeeMgmtConnectionString %>">
SelectCommand="SELECT [CustomerID], [CustomerName] FROM [Customers]"></asp:sqldatasource>
</div>
</form>
</body>
</html>
Code-behinded
==============
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) {
string script = "SetUniqueRadioButton('" + GridView1.ClientID + ".*rbBox',this)";
RadioButton rb = (RadioButton)e.Row.FindControl("RadioButton1");
if(rb != null)rb.Attributes.Add("onclick", script);
}
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
Hi all,
I'm using WSE 3.0 in my project to connect a web application to a web
service. I'm using username token for WSE. In some pages where I have upload
file controls I get an exception saying :
The underlying connection was closed: An unexpected error occurred on a
receive.
I have searched online and found that this problem is a well known bug in
.NET 1.1 and I also found a way to solve it by modifying some code in the
reference.cs file of the web service proxy in the web application. However I
didn't manage to find a reference to the problem in .NET 2.0. Is there a way
to access the reference.cs file in a web application developped with .NET
2.0? If not, how can I fix this problem?
I have also tried to turn off the keep-alive option of the website from the
IIS console but that resulted in other behavioral problems. I'm using
Windows Server 2003 with IIS 6.
Ultimately, if there is no way to fix this, can someone direct me towards a
file upload control that I could use that might fix this problem? I am
wondering if this problem is related to another problem I am having: when
uploading files (one or multiple file upload controls on same page) a
timeout occurs where IE shows that it is still waiting for a reply from the
server and nothing happens. If I check the server, I notice that it has
finished processing the request and the database has been populated with the
results but nothing goes back to the IE client.
Thanks for your help,
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
|
|
|
|
|
Hi Friends,
I am using two method onclick of my button.
OnClientClick="ValidateDates() (Client Side Validation Method)
function ValidateDates()
{
//Get both datesvar startDate = eo_GetObject("OpenDatePicker").getSelectedDate();
var startDate = eo_GetObject("ArrivalDatePicker").getSelectedDate() ;
var endDate = eo_GetObject("DepartureDatePicker").getSelectedDate() ;
//Check if both dates are provided
if ((startDate == null) || (endDate == null))
{
alert("Please enter both Arrival and Departure dates.");
return false;
}
if (startDate.valueOf() > endDate.valueOf())
{
alert("The Arrival date must be before the Departure date.");
return false;
}
}
OnClick="addItinerary" Server Side Method
Now i am getting Alert on the Condition But my Server side Method is also being called at same time.
I want it to return when it Gets alert on Client side Validation.
Any suggestions or help would be highly appreciated
Thanks
Menon
Cheers
Menon
|
|
|
|
|
You should add return in onclick event.
For example :
onclick="return ValidateDates();"
|
|
|
|
|
Thank you very much Micheal,
It worked fine for me..
Thanks
Cheers
Menon
|
|
|
|
|
I'm really wondering who did this..
1) no matter whether it's easy or not. It solved other people's problem.
2) It's already 1:10 AM in my country but i'm still reading this forum...
but some people voted down my post... Can you please tell me what wrong with my post? Thanks.
|
|
|
|
|
Mec ... is korrect
Use return where you have called the event
P.S.
|
|
|
|
|
What s the major difference between <div> and <table></table></div>
|
|
|
|
|
The table can have the rows and columns while the DIV can't.
As the differences between table and DIV are so obvious, I think that you might not ask about that. maybe, you are asking about the differences between table layout and Div (float) layout.. Table layout Vs Div layout[^]
|
|
|
|